1228753Smm/*- 2228753Smm * Copyright (c) 2003-2007 Tim Kientzle 3228753Smm * All rights reserved. 4228753Smm * 5228753Smm * Redistribution and use in source and binary forms, with or without 6228753Smm * modification, are permitted provided that the following conditions 7228753Smm * are met: 8228753Smm * 1. Redistributions of source code must retain the above copyright 9228753Smm * notice, this list of conditions and the following disclaimer. 10228753Smm * 2. Redistributions in binary form must reproduce the above copyright 11228753Smm * notice, this list of conditions and the following disclaimer in the 12228753Smm * documentation and/or other materials provided with the distribution. 13228753Smm * 14228753Smm * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR 15228753Smm * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 16228753Smm * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 17228753Smm * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, 18228753Smm * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19228753Smm * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20228753Smm * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21228753Smm * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22228753Smm * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23228753Smm * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24228753Smm * 25228763Smm * $FreeBSD$ 26228753Smm */ 27228753Smm 28228753Smm/* 29228753Smm * This header is the first thing included in any of the cpio 30228753Smm * source files. As far as possible, platform-specific issues should 31228753Smm * be dealt with here and not within individual source files. 32228753Smm */ 33228753Smm 34228753Smm#ifndef CPIO_PLATFORM_H_INCLUDED 35228753Smm#define CPIO_PLATFORM_H_INCLUDED 36228753Smm 37228753Smm#if defined(PLATFORM_CONFIG_H) 38228753Smm/* Use hand-built config.h in environments that need it. */ 39228753Smm#include PLATFORM_CONFIG_H 40228753Smm#else 41228753Smm/* Read config.h or die trying. */ 42228753Smm#include "config.h" 43228753Smm#endif 44228753Smm 45228753Smm/* Get a real definition for __FBSDID if we can */ 46228753Smm#if HAVE_SYS_CDEFS_H 47228753Smm#include <sys/cdefs.h> 48228753Smm#endif 49228753Smm 50228753Smm/* If not, define it so as to avoid dangling semicolons. */ 51228753Smm#ifndef __FBSDID 52228753Smm#define __FBSDID(a) struct _undefined_hack 53228753Smm#endif 54228753Smm 55228753Smm#ifdef HAVE_LIBARCHIVE 56228753Smm/* If we're using the platform libarchive, include system headers. */ 57228753Smm#include <archive.h> 58228753Smm#include <archive_entry.h> 59228753Smm#else 60228753Smm/* Otherwise, include user headers. */ 61228753Smm#include "archive.h" 62228753Smm#include "archive_entry.h" 63228753Smm#endif 64228753Smm 65228753Smm/* How to mark functions that don't return. */ 66228753Smm#if defined(__GNUC__) && (__GNUC__ > 2 || \ 67228753Smm (__GNUC__ == 2 && __GNUC_MINOR__ >= 5)) 68228753Smm#define __LA_DEAD __attribute__((__noreturn__)) 69228753Smm#else 70228753Smm#define __LA_DEAD 71228753Smm#endif 72228753Smm 73228753Smm#if defined(_WIN32) && !defined(__CYGWIN__) 74228753Smm#include "cpio_windows.h" 75228753Smm#endif 76228753Smm 77228753Smm#endif /* !CPIO_PLATFORM_H_INCLUDED */ 78