machine/endian.h is getting picked up on OS X with gcc 4.0 but no endian.h exists.
This commit is contained in:
@@ -10,11 +10,8 @@ typedef signed long SInt32;
|
|||||||
typedef signed long long SInt64;
|
typedef signed long long SInt64;
|
||||||
typedef unsigned long long UInt64;
|
typedef unsigned long long UInt64;
|
||||||
|
|
||||||
#define __MACTYPES__
|
#include <CarbonCore/Endian.h>
|
||||||
#include <libkern/OSByteOrder.h>
|
|
||||||
#undef __MACTYPES__
|
|
||||||
#define BACKTRACE_LOOKUP_METHOD_DARWIN_DYLD
|
|
||||||
#define BACKTRACE_METHOD_POWERPC_DARWIN
|
|
||||||
#define HAVE_VERSION_INFO
|
#define HAVE_VERSION_INFO
|
||||||
#define HAVE_CXA_DEMANGLE
|
#define HAVE_CXA_DEMANGLE
|
||||||
#define HAVE_CRYPTOPP
|
#define HAVE_CRYPTOPP
|
||||||
@@ -22,14 +19,21 @@ typedef unsigned long long UInt64;
|
|||||||
#define HAVE_FFMPEG
|
#define HAVE_FFMPEG
|
||||||
#define HAVE_SDL
|
#define HAVE_SDL
|
||||||
#define HAVE_PTHREAD_COND_TIMEDWAIT
|
#define HAVE_PTHREAD_COND_TIMEDWAIT
|
||||||
#define CRASH_HANDLER
|
|
||||||
|
/* We have <machine/endian.h> which gets pulled in when we use gcc 4.0's <cstdlib>
|
||||||
|
* but no <endian.h>. The definitions of LITTLE_ENDIAN, BIG_ENDIAN and end up conflicting
|
||||||
|
* even though they resolve to the same thing (bug in gcc?). */
|
||||||
|
#define HAVE_MACHINE_ENDIAN_H
|
||||||
|
|
||||||
// Looking ahead to "Universal binaries."
|
// Looking ahead to "Universal binaries."
|
||||||
#ifdef __BIG_ENDIAN__
|
#ifdef __ppc__
|
||||||
# define ENDIAN_BIG
|
# define ENDIAN_BIG
|
||||||
|
# define BACKTRACE_LOOKUP_METHOD_DARWIN_DYLD
|
||||||
|
# define BACKTRACE_METHOD_POWERPC_DARWIN
|
||||||
|
# define CRASH_HANDLER
|
||||||
#else
|
#else
|
||||||
# define ENDIAN_LITTLE
|
# define ENDIAN_LITTLE
|
||||||
#endif
|
#endif
|
||||||
#define ENDIAN_BIG
|
|
||||||
|
|
||||||
#ifndef MACOSX
|
#ifndef MACOSX
|
||||||
# define MACOSX
|
# define MACOSX
|
||||||
@@ -37,43 +41,55 @@ typedef unsigned long long UInt64;
|
|||||||
#ifndef __MACOSX__
|
#ifndef __MACOSX__
|
||||||
# define __MACOSX__
|
# define __MACOSX__
|
||||||
#endif
|
#endif
|
||||||
#define ArchSwap32(n) OSSwapInt32((n))
|
|
||||||
#define ArchSwap24(n) (OSSwapInt32((n)) >> 8)
|
// EndianX_Swap() will use the constant swapper macro if n is a compile time constant
|
||||||
#define ArchSwap16(n) OSSwapInt16((n))
|
#define ArchSwap32(n) Endian32_Swap(n)
|
||||||
|
#define ArchSwap24(n) (Endian32_Swap(n) >> 8)
|
||||||
|
#define ArchSwap16(n) Endian16_Swap(n)
|
||||||
#define HAVE_BYTE_SWAPS
|
#define HAVE_BYTE_SWAPS
|
||||||
|
|
||||||
#include <bits/c++config.h>
|
#include <bits/c++config.h>
|
||||||
#if ! _GLIBCPP_HAVE_POWF
|
// This is very annoying. The 10.2.8 SDK uses GLIBCPP but the 10.4u SDK uses GLIBCXX
|
||||||
|
#if __GLIBCPP__
|
||||||
|
# define GLIB_PREFIX _GLIBCPP_
|
||||||
|
#elif __GLIBCXX__
|
||||||
|
# define GLIB_PREFIX _GLIBCXX_
|
||||||
|
#else
|
||||||
|
# error Neither __GLIBCPP__ nor __GLIBCXX__ was defined.
|
||||||
|
#endif
|
||||||
|
#define CHECK(x) (GLIB_PREFIX ## x)
|
||||||
|
|
||||||
|
#if ! CHECK(HAVE_POWF)
|
||||||
# define NEED_POWF
|
# define NEED_POWF
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ! _GLIBCPP_HAVE_SQRTF
|
#if ! CHECK(HAVE_SQRTF)
|
||||||
# define NEED_SQRTF
|
# define NEED_SQRTF
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ! _GLIBCPP_HAVE_SINF
|
#if ! CHECK(HAVE_SINF)
|
||||||
# define NEED_SINF
|
# define NEED_SINF
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ! _GLIBCPP_HAVE_TANF
|
#if ! CHECK(HAVE_TANF)
|
||||||
# define NEED_TANF
|
# define NEED_TANF
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ! _GLIBCPP_HAVE_COSF
|
#if ! CHECK(HAVE_COSF)
|
||||||
# define NEED_COSF
|
# define NEED_COSF
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ! _GLIBCPP_HAVE_ACOSF
|
#if ! CHECK(HAVE_ACOSF)
|
||||||
# define NEED_ACOSF
|
# define NEED_ACOSF
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ! _GLIBCPP_HAVE_STRTOF
|
#if ! CHECK(HAVE_STRTOF)
|
||||||
# define NEED_STRTOF
|
# define NEED_STRTOF
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Define the work around if needed.
|
// Define the work around if needed.
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#if _GLIBCPP_USE_C99
|
#if CHECK(USE_C99)
|
||||||
# define NEED_CSTDLIB_WORKAROUND
|
# define NEED_CSTDLIB_WORKAROUND
|
||||||
#else
|
#else
|
||||||
inline int64_t llabs( int64_t x ) { return x < 0LL ? -x : x; }
|
inline int64_t llabs( int64_t x ) { return x < 0LL ? -x : x; }
|
||||||
@@ -103,7 +119,7 @@ typedef int socklen_t;
|
|||||||
__isnan ( x ) )
|
__isnan ( x ) )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ! _GLIBCPP_USE_WCHAR_T
|
#if ! CHECK(USE_WCHAR_T)
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
@@ -174,6 +190,10 @@ namespace std
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Cleanup macros
|
||||||
|
#undef GLIB_PREFIX
|
||||||
|
#undef CHECK
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -29,6 +29,8 @@
|
|||||||
/* Define standard endianness macros, if they're missing. */
|
/* Define standard endianness macros, if they're missing. */
|
||||||
#if defined(HAVE_ENDIAN_H)
|
#if defined(HAVE_ENDIAN_H)
|
||||||
#include <endian.h>
|
#include <endian.h>
|
||||||
|
#elif defined(HAVE_MACHINE_ENDIAN_H)
|
||||||
|
#include <machine/endian.h>
|
||||||
#else
|
#else
|
||||||
#define LITTLE_ENDIAN 1234
|
#define LITTLE_ENDIAN 1234
|
||||||
#define BIG_ENDIAN 4321
|
#define BIG_ENDIAN 4321
|
||||||
|
|||||||
Reference in New Issue
Block a user