From ec5878964488ff08ba55c01c54406c5ca009c966 Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Thu, 3 Jan 2008 03:32:56 +0000 Subject: [PATCH] Remove code needed for supporting 10.2.8 since we don't any more. --- stepmania/src/archutils/Darwin/arch_setup.h | 160 ++------------------ 1 file changed, 11 insertions(+), 149 deletions(-) diff --git a/stepmania/src/archutils/Darwin/arch_setup.h b/stepmania/src/archutils/Darwin/arch_setup.h index e58736e40b..12aba50448 100644 --- a/stepmania/src/archutils/Darwin/arch_setup.h +++ b/stepmania/src/archutils/Darwin/arch_setup.h @@ -5,19 +5,7 @@ extern "C" int SM_main( int argc, char *argv[] ); #define main(x,y) SM_main(x,y) -typedef unsigned char UInt8; -typedef signed char SInt8; -typedef unsigned short UInt16; -typedef signed short SInt16; -typedef unsigned long UInt32; -typedef signed long SInt32; -typedef signed long long SInt64; -typedef unsigned long long UInt64; - -// We cannot include MacTypes.h here because it defines Style which conflicts with struct Style. -#define __MACTYPES__ #include -#undef __MACTYPES__ #define HAVE_VERSION_INFO #define HAVE_CXA_DEMANGLE @@ -55,174 +43,48 @@ typedef unsigned long long UInt64; # define __MACOSX__ #endif -#define ArchSwap32(n) (__builtin_constant_p(n) ? OSSwapConstInt32(n) : OSSwapInt32(n)) -#define ArchSwap24(n) (ArchSwap32(n) >> 8) -#define ArchSwap16(n) (__builtin_constant_p(n) ? OSSwapConstInt16(n) : OSSwapInt16(n)) +#define ArchSwap32(n) OSSwapInt32((n)) +#define ArchSwap24(n) (ArchSwap32((n)) >> 8) +#define ArchSwap16(n) OSSwapInt16((n)) #define HAVE_BYTE_SWAPS #include -// This is very annoying. The 10.2.8 SDK uses GLIBCPP but the 10.4u SDK uses GLIBCXX -#define _GLIB_CHECK(x) (_GLIBCPP_ ## x || _GLIBCXX_ ## x) - -#if ! _GLIB_CHECK(HAVE_POWF) +#if ! _GLIBCXX_HAVE_POWF # define NEED_POWF #endif -#if ! _GLIB_CHECK(HAVE_SQRTF) +#if ! _GLIBCXX_HAVE_SQRTF # define NEED_SQRTF #endif -#if ! _GLIB_CHECK(HAVE_SINF) +#if ! _GLIBCXX_HAVE_SINF # define NEED_SINF #endif -#if ! _GLIB_CHECK(HAVE_TANF) +#if ! _GLIBCXX_HAVE_TANF # define NEED_TANF #endif -#if ! _GLIB_CHECK(HAVE_COSF) +#if ! _GLIBCXX_HAVE_COSF # define NEED_COSF #endif -#if ! _GLIB_CHECK(HAVE_ACOSF) +#if ! _GLIBCXX_HAVE_ACOSF # define NEED_ACOSF #endif -#if ! _GLIB_CHECK(HAVE_STRTOF) +#if ! _GLIBCXX_HAVE_STRTOF # define NEED_STRTOF #endif // Define the work around if needed. #include -#if _GLIB_CHECK(USE_C99) +#if _GLIBCXX_USE_C99 # define NEED_CSTDLIB_WORKAROUND #else inline int64_t llabs( int64_t x ) { return x < 0LL ? -x : x; } - -/* This is not correct. It's possible that _GLIBCPP_USE_C99 could be false - * and yet have socklen_t defined. In the BSD world, this seems to come from - * . However, all apple headers that include this have: - * #ifndef __APPLE__ - * #include - * #endif - * Since it appears we shouldn't include that for OS X builds, let's just - * make the assumption that if we can use c99 that socklen_t is defined and - * if we cannot, then it isn't. For the only two builds (on OS X) we care about, - * namely supporting 10.2.8 and the current OS, this _should_ hold true. - */ -typedef int socklen_t; - -/* cmath #undefs all of the math.h macros but fails to replace some of them - * with functions if _GLIBCPP_USE_C99 is not defined. As such, yank the - * definitions out of math.h. - */ -#include -#define fpclassify( x ) ( ( sizeof ( x ) == sizeof(double) ) ? \ - __fpclassifyd ( x ) : \ - ( sizeof ( x ) == sizeof( float) ) ? \ - __fpclassifyf ( x ) : \ - __fpclassify ( x ) ) -#define isnormal( x ) ( ( sizeof ( x ) == sizeof(double) ) ? \ - __isnormald ( x ) : \ - ( sizeof ( x ) == sizeof( float) ) ? \ - __isnormalf ( x ) : \ - __isnormal ( x ) ) -#define isfinite( x ) ( ( sizeof ( x ) == sizeof(double) ) ? \ - __isfinited ( x ) : \ - ( sizeof ( x ) == sizeof( float) ) ? \ - __isfinitef ( x ) : \ - __isfinite ( x ) ) -#define isinf( x ) ( ( sizeof ( x ) == sizeof(double) ) ? \ - __isinfd ( x ) : \ - ( sizeof ( x ) == sizeof( float) ) ? \ - __isinff ( x ) : \ - __isinf ( x ) ) -#define isnan( x ) ( ( sizeof ( x ) == sizeof(double) ) ? \ - __isnand ( x ) : \ - ( sizeof ( x ) == sizeof( float) ) ? \ - __isnanf ( x ) : \ - __isnan ( x ) ) -#define signbit( x ) ( ( sizeof ( x ) == sizeof(double) ) ? \ - __signbitd ( x ) : \ - ( sizeof ( x ) == sizeof( float) ) ? \ - __signbitf ( x ) : \ - __signbitl ( x ) ) #endif -#if ! _GLIB_CHECK(USE_WCHAR_T) -#include - -extern "C" -{ - extern size_t wcslen( const wchar_t *ws ); - extern wchar_t *wmemchr( const wchar_t *ws, wchar_t wc, size_t n ); - extern int wmemcmp( const wchar_t *ws1, const wchar_t *ws2, size_t n ); - extern wchar_t *wmemcpy( wchar_t *ws1, const wchar_t *ws2, size_t n ); - extern wchar_t *wmemmove( wchar_t *ws1, const wchar_t *ws2, size_t n ); - extern wchar_t *wmemset( wchar_t *ws , wchar_t wc, size_t n ); -} -// C++ defines the wchar_t type even if glibc++ doesn't have the functions -namespace std -{ - /* This is actually illegal but it should work. =) - * In addition, it's not complete, but it's good enough for us. - * http://www.unl.csi.cuny.edu/faqs/g++-faq/wp/sep96/lib-strings.html - */ - template<> struct char_traits - { - typedef wchar_t char_type; - typedef wchar_t int_type; // it's big enough - /* - * streampos and wstreampos are both required to be typedefs for - * fpos as per clause 27.2--whatever that is. - */ - typedef streampos pos_type; - typedef streamoff off_type; - typedef mbstate_t state_type; - - static void assign( char_type& c1, const char_type c2 ) - { - c1 = c2; - } - - static void assign( char_type *s, size_t n, char_type c ) - { - wmemset( s, c, n ); - } - - static int compare( const char_type *s1, const char_type *s2, size_t n ) - { - return wmemcmp( s1, s2, n ); - } - - static char_type *copy( char_type *s1, const char_type *s2, size_t n ) - { - return wmemcpy( s1, s2, n ); - } - - static const char_type *find( const char_type *s, size_t n, const char_type& c ) - { - return wmemchr( s, c, n ); - } - - static size_t length( const char_type *s ) - { - return wcslen( s ); - } - - static char_type *move( char_type *s1, const char_type *s2, size_t n ) - { - return wmemmove( s1, s2, n ); - } - }; - - typedef basic_string wstring; -} -#endif - -// Cleanup macro -#undef _GLIB_CHECK - #include #ifndef EILSEQ #define EILSEQ 92