Home | History | Annotate | Line # | Download | only in cat
      1      1.1     joerg /*-
      2  1.1.1.3  christos  * SPDX-License-Identifier: BSD-2-Clause
      3  1.1.1.3  christos  *
      4      1.1     joerg  * Copyright (c) 2003-2007 Tim Kientzle
      5      1.1     joerg  * All rights reserved.
      6      1.1     joerg  */
      7      1.1     joerg 
      8      1.1     joerg /*
      9      1.1     joerg  * This header is the first thing included in any of the bsdtar
     10      1.1     joerg  * source files.  As far as possible, platform-specific issues should
     11      1.1     joerg  * be dealt with here and not within individual source files.
     12      1.1     joerg  */
     13      1.1     joerg 
     14      1.1     joerg #ifndef BSDCAT_PLATFORM_H_INCLUDED
     15      1.1     joerg #define	BSDCAT_PLATFORM_H_INCLUDED
     16      1.1     joerg 
     17      1.1     joerg #if defined(PLATFORM_CONFIG_H)
     18      1.1     joerg /* Use hand-built config.h in environments that need it. */
     19      1.1     joerg #include PLATFORM_CONFIG_H
     20      1.1     joerg #else
     21      1.1     joerg /* Not having a config.h of some sort is a serious problem. */
     22      1.1     joerg #include "config.h"
     23      1.1     joerg #endif
     24      1.1     joerg 
     25      1.1     joerg #ifdef HAVE_LIBARCHIVE
     26      1.1     joerg /* If we're using the platform libarchive, include system headers. */
     27      1.1     joerg #include <archive.h>
     28      1.1     joerg #include <archive_entry.h>
     29      1.1     joerg #else
     30      1.1     joerg /* Otherwise, include user headers. */
     31      1.1     joerg #include "archive.h"
     32      1.1     joerg #include "archive_entry.h"
     33      1.1     joerg #endif
     34      1.1     joerg 
     35      1.1     joerg /* How to mark functions that don't return. */
     36      1.1     joerg /* This facilitates use of some newer static code analysis tools. */
     37  1.1.1.2  christos #undef __LA_NORETURN
     38      1.1     joerg #if defined(__GNUC__) && (__GNUC__ > 2 || \
     39  1.1.1.2  christos                           (__GNUC__ == 2 && __GNUC_MINOR__ >= 5))
     40  1.1.1.2  christos #define __LA_NORETURN       __attribute__((__noreturn__))
     41  1.1.1.2  christos #elif defined(_MSC_VER)
     42  1.1.1.2  christos #define __LA_NORETURN __declspec(noreturn)
     43  1.1.1.3  christos #else
     44  1.1.1.2  christos #define __LA_NORETURN
     45      1.1     joerg #endif
     46      1.1     joerg 
     47      1.1     joerg #endif /* !BSDCAT_PLATFORM_H_INCLUDED */
     48