Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-03 08:13:17

0001 // -*- C++ -*-
0002 //===----------------------------------------------------------------------===//
0003 //
0004 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0005 // See https://llvm.org/LICENSE.txt for license information.
0006 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0007 //
0008 //===----------------------------------------------------------------------===//
0009 
0010 #ifndef _LIBCPP___CONFIGURATION_PLATFORM_H
0011 #define _LIBCPP___CONFIGURATION_PLATFORM_H
0012 
0013 #include <__config_site>
0014 
0015 #ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
0016 #  pragma GCC system_header
0017 #endif
0018 
0019 #if defined(__ELF__)
0020 #  define _LIBCPP_OBJECT_FORMAT_ELF 1
0021 #elif defined(__MACH__)
0022 #  define _LIBCPP_OBJECT_FORMAT_MACHO 1
0023 #elif defined(_WIN32)
0024 #  define _LIBCPP_OBJECT_FORMAT_COFF 1
0025 #elif defined(__wasm__)
0026 #  define _LIBCPP_OBJECT_FORMAT_WASM 1
0027 #elif defined(_AIX)
0028 #  define _LIBCPP_OBJECT_FORMAT_XCOFF 1
0029 #else
0030 // ... add new file formats here ...
0031 #endif
0032 
0033 // Need to detect which libc we're using if we're on Linux.
0034 #if defined(__linux__) || defined(__AMDGPU__) || defined(__NVPTX__)
0035 #  if __has_include(<features.h>)
0036 #    include <features.h>
0037 #    if defined(__GLIBC_PREREQ)
0038 #      define _LIBCPP_GLIBC_PREREQ(a, b) __GLIBC_PREREQ(a, b)
0039 #    else
0040 #      define _LIBCPP_GLIBC_PREREQ(a, b) 0
0041 #    endif // defined(__GLIBC_PREREQ)
0042 #  endif
0043 #endif
0044 
0045 // This is required in order for _NEWLIB_VERSION to be defined in places where we use it.
0046 // TODO: We shouldn't be including arbitrarily-named headers from libc++ since this can break valid
0047 //       user code. Move code paths that need _NEWLIB_VERSION to another customization mechanism.
0048 #if __has_include(<picolibc.h>)
0049 #  include <picolibc.h>
0050 #endif
0051 
0052 #ifndef __BYTE_ORDER__
0053 #  error                                                                                                               \
0054       "Your compiler doesn't seem to define __BYTE_ORDER__, which is required by libc++ to know the endianness of your target platform"
0055 #endif
0056 
0057 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
0058 #  define _LIBCPP_LITTLE_ENDIAN
0059 #elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
0060 #  define _LIBCPP_BIG_ENDIAN
0061 #endif // __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
0062 
0063 #endif // _LIBCPP___CONFIGURATION_PLATFORM_H