1*caf54c4fSMartin Matuska /*- 2*caf54c4fSMartin Matuska * Copyright (c) 2003-2007 Tim Kientzle 3*caf54c4fSMartin Matuska * All rights reserved. 4*caf54c4fSMartin Matuska * 5*caf54c4fSMartin Matuska * Redistribution and use in source and binary forms, with or without 6*caf54c4fSMartin Matuska * modification, are permitted provided that the following conditions 7*caf54c4fSMartin Matuska * are met: 8*caf54c4fSMartin Matuska * 1. Redistributions of source code must retain the above copyright 9*caf54c4fSMartin Matuska * notice, this list of conditions and the following disclaimer. 10*caf54c4fSMartin Matuska * 2. Redistributions in binary form must reproduce the above copyright 11*caf54c4fSMartin Matuska * notice, this list of conditions and the following disclaimer in the 12*caf54c4fSMartin Matuska * documentation and/or other materials provided with the distribution. 13*caf54c4fSMartin Matuska * 14*caf54c4fSMartin Matuska * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR 15*caf54c4fSMartin Matuska * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 16*caf54c4fSMartin Matuska * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 17*caf54c4fSMartin Matuska * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, 18*caf54c4fSMartin Matuska * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19*caf54c4fSMartin Matuska * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20*caf54c4fSMartin Matuska * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21*caf54c4fSMartin Matuska * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22*caf54c4fSMartin Matuska * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23*caf54c4fSMartin Matuska * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24*caf54c4fSMartin Matuska * 25*caf54c4fSMartin Matuska * $FreeBSD: src/usr.bin/cpio/cpio_platform.h,v 1.2 2008/12/06 07:15:42 kientzle Exp $ 26*caf54c4fSMartin Matuska */ 27*caf54c4fSMartin Matuska 28*caf54c4fSMartin Matuska /* 29*caf54c4fSMartin Matuska * This header is the first thing included in any of the cpio 30*caf54c4fSMartin Matuska * source files. As far as possible, platform-specific issues should 31*caf54c4fSMartin Matuska * be dealt with here and not within individual source files. 32*caf54c4fSMartin Matuska */ 33*caf54c4fSMartin Matuska 34*caf54c4fSMartin Matuska #ifndef CPIO_PLATFORM_H_INCLUDED 35*caf54c4fSMartin Matuska #define CPIO_PLATFORM_H_INCLUDED 36*caf54c4fSMartin Matuska 37*caf54c4fSMartin Matuska #if defined(PLATFORM_CONFIG_H) 38*caf54c4fSMartin Matuska /* Use hand-built config.h in environments that need it. */ 39*caf54c4fSMartin Matuska #include PLATFORM_CONFIG_H 40*caf54c4fSMartin Matuska #else 41*caf54c4fSMartin Matuska /* Read config.h or die trying. */ 42*caf54c4fSMartin Matuska #include "config.h" 43*caf54c4fSMartin Matuska #endif 44*caf54c4fSMartin Matuska 45*caf54c4fSMartin Matuska /* Get a real definition for __FBSDID if we can */ 46*caf54c4fSMartin Matuska #if HAVE_SYS_CDEFS_H 47*caf54c4fSMartin Matuska #include <sys/cdefs.h> 48*caf54c4fSMartin Matuska #endif 49*caf54c4fSMartin Matuska 50*caf54c4fSMartin Matuska /* If not, define it so as to avoid dangling semicolons. */ 51*caf54c4fSMartin Matuska #ifndef __FBSDID 52*caf54c4fSMartin Matuska #define __FBSDID(a) struct _undefined_hack 53*caf54c4fSMartin Matuska #endif 54*caf54c4fSMartin Matuska 55*caf54c4fSMartin Matuska #ifdef HAVE_LIBARCHIVE 56*caf54c4fSMartin Matuska /* If we're using the platform libarchive, include system headers. */ 57*caf54c4fSMartin Matuska #include <archive.h> 58*caf54c4fSMartin Matuska #include <archive_entry.h> 59*caf54c4fSMartin Matuska #else 60*caf54c4fSMartin Matuska /* Otherwise, include user headers. */ 61*caf54c4fSMartin Matuska #include "archive.h" 62*caf54c4fSMartin Matuska #include "archive_entry.h" 63*caf54c4fSMartin Matuska #endif 64*caf54c4fSMartin Matuska 65*caf54c4fSMartin Matuska /* How to mark functions that don't return. */ 66*caf54c4fSMartin Matuska #if defined(__GNUC__) && (__GNUC__ > 2 || \ 67*caf54c4fSMartin Matuska (__GNUC__ == 2 && __GNUC_MINOR__ >= 5)) 68*caf54c4fSMartin Matuska #define __LA_DEAD __attribute__((__noreturn__)) 69*caf54c4fSMartin Matuska #else 70*caf54c4fSMartin Matuska #define __LA_DEAD 71*caf54c4fSMartin Matuska #endif 72*caf54c4fSMartin Matuska 73*caf54c4fSMartin Matuska #if defined(_WIN32) && !defined(__CYGWIN__) 74*caf54c4fSMartin Matuska #include "cpio_windows.h" 75*caf54c4fSMartin Matuska #endif 76*caf54c4fSMartin Matuska 77*caf54c4fSMartin Matuska #endif /* !CPIO_PLATFORM_H_INCLUDED */ 78