1caf54c4fSMartin Matuska /*- 2*bd66c1b4SMartin Matuska * SPDX-License-Identifier: BSD-2-Clause 3*bd66c1b4SMartin Matuska * 4caf54c4fSMartin Matuska * Copyright (c) 2003-2007 Tim Kientzle 5caf54c4fSMartin Matuska * All rights reserved. 6caf54c4fSMartin Matuska */ 7caf54c4fSMartin Matuska 8caf54c4fSMartin Matuska /* 9caf54c4fSMartin Matuska * This header is the first thing included in any of the cpio 10caf54c4fSMartin Matuska * source files. As far as possible, platform-specific issues should 11caf54c4fSMartin Matuska * be dealt with here and not within individual source files. 12caf54c4fSMartin Matuska */ 13caf54c4fSMartin Matuska 14caf54c4fSMartin Matuska #ifndef CPIO_PLATFORM_H_INCLUDED 15caf54c4fSMartin Matuska #define CPIO_PLATFORM_H_INCLUDED 16caf54c4fSMartin Matuska 17caf54c4fSMartin Matuska #if defined(PLATFORM_CONFIG_H) 18caf54c4fSMartin Matuska /* Use hand-built config.h in environments that need it. */ 19caf54c4fSMartin Matuska #include PLATFORM_CONFIG_H 20caf54c4fSMartin Matuska #else 21caf54c4fSMartin Matuska /* Read config.h or die trying. */ 22caf54c4fSMartin Matuska #include "config.h" 23caf54c4fSMartin Matuska #endif 24caf54c4fSMartin Matuska 25cdf63a70SMartin Matuska #if defined(_WIN32) && !defined(__CYGWIN__) 26cdf63a70SMartin Matuska #include "cpio_windows.h" 27cdf63a70SMartin Matuska #endif 28cdf63a70SMartin Matuska 29caf54c4fSMartin Matuska #ifdef HAVE_LIBARCHIVE 30caf54c4fSMartin Matuska /* If we're using the platform libarchive, include system headers. */ 31caf54c4fSMartin Matuska #include <archive.h> 32caf54c4fSMartin Matuska #include <archive_entry.h> 33caf54c4fSMartin Matuska #else 34caf54c4fSMartin Matuska /* Otherwise, include user headers. */ 35caf54c4fSMartin Matuska #include "archive.h" 36caf54c4fSMartin Matuska #include "archive_entry.h" 37caf54c4fSMartin Matuska #endif 38caf54c4fSMartin Matuska 39caf54c4fSMartin Matuska /* How to mark functions that don't return. */ 40caf54c4fSMartin Matuska #if defined(__GNUC__) && (__GNUC__ > 2 || \ 41caf54c4fSMartin Matuska (__GNUC__ == 2 && __GNUC_MINOR__ >= 5)) 42b9128a37SMartin Matuska #define __LA_NORETURN __attribute__((__noreturn__)) 43b9128a37SMartin Matuska #elif defined(_MSC_VER) 44b9128a37SMartin Matuska #define __LA_NORETURN __declspec(noreturn) 45caf54c4fSMartin Matuska #else 46b9128a37SMartin Matuska #define __LA_NORETURN 47caf54c4fSMartin Matuska #endif 48caf54c4fSMartin Matuska 49caf54c4fSMartin Matuska #endif /* !CPIO_PLATFORM_H_INCLUDED */ 50