55 lines · c
1// -*- C++ -*-2//===----------------------------------------------------------------------===//3//4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.5// See https://llvm.org/LICENSE.txt for license information.6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception7//8//===----------------------------------------------------------------------===//9 10#ifndef _LIBCPP___CXX03___CONFIGURATION_PLATFORM_H11#define _LIBCPP___CXX03___CONFIGURATION_PLATFORM_H12 13#include <__cxx03/__configuration/config_site_shim.h>14 15#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER16# pragma GCC system_header17#endif18 19#if defined(__ELF__)20# define _LIBCPP_OBJECT_FORMAT_ELF 121#elif defined(__MACH__)22# define _LIBCPP_OBJECT_FORMAT_MACHO 123#elif defined(_WIN32)24# define _LIBCPP_OBJECT_FORMAT_COFF 125#elif defined(__wasm__)26# define _LIBCPP_OBJECT_FORMAT_WASM 127#elif defined(_AIX)28# define _LIBCPP_OBJECT_FORMAT_XCOFF 129#else30// ... add new file formats here ...31#endif32 33// Need to detect which libc we're using if we're on Linux.34#if defined(__linux__)35# include <features.h>36# if defined(__GLIBC_PREREQ)37# define _LIBCPP_GLIBC_PREREQ(a, b) __GLIBC_PREREQ(a, b)38# else39# define _LIBCPP_GLIBC_PREREQ(a, b) 040# endif // defined(__GLIBC_PREREQ)41#endif // defined(__linux__)42 43#ifndef __BYTE_ORDER__44# error \45 "Your compiler doesn't seem to define __BYTE_ORDER__, which is required by libc++ to know the endianness of your target platform"46#endif47 48#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__49# define _LIBCPP_LITTLE_ENDIAN50#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__51# define _LIBCPP_BIG_ENDIAN52#endif // __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__53 54#endif // _LIBCPP___CXX03___CONFIGURATION_PLATFORM_H55