More fixes for building on BeOS
authorSam Lantinga <slouken@libsdl.org>
Sat, 18 Feb 2006 06:51:00 +0000
changeset 1368533567cbb576
parent 1367 e440d5c488c1
child 1369 42eeb14770e3
More fixes for building on BeOS
include/SDL_endian.h
include/SDL_stdinc.h
     1.1 --- a/include/SDL_endian.h	Fri Feb 17 08:43:23 2006 +0000
     1.2 +++ b/include/SDL_endian.h	Sat Feb 18 06:51:00 2006 +0000
     1.3 @@ -52,12 +52,13 @@
     1.4  extern "C" {
     1.5  #endif
     1.6  
     1.7 -/* Use inline functions for compilers that support them, and static
     1.8 +/* Use __inline__ functions for compilers that support them, and static
     1.9     functions for those that do not.  Because these functions become
    1.10 -   static for compilers that do not support inline functions, this
    1.11 +   static for compilers that do not support __inline__ functions, this
    1.12     header should only be included in files that actually use them.
    1.13  */
    1.14 -#if defined(__GNUC__) && defined(__i386__)
    1.15 +#if defined(__GNUC__) && defined(__i386__) &&
    1.16 +   !(__GNUC__ == 2 && __GNUC_MINOR__ == 95 /* broken gcc version */)
    1.17  static __inline__ Uint16 SDL_Swap16(Uint16 x)
    1.18  {
    1.19  	__asm__("xchgb %b0,%h0" : "=q" (x) :  "0" (x));
     2.1 --- a/include/SDL_stdinc.h	Fri Feb 17 08:43:23 2006 +0000
     2.2 +++ b/include/SDL_stdinc.h	Sat Feb 18 06:51:00 2006 +0000
     2.3 @@ -28,23 +28,19 @@
     2.4  #include "SDL_config.h"
     2.5  
     2.6  /* AIX requires this to be the first thing in the file.  */
     2.7 -#ifdef __GNUC__
     2.8 -# define alloca __builtin_alloca
     2.9 -#else
    2.10 -# ifdef _MSC_VER
    2.11 +#if HAVE_ALLOCA
    2.12 +# if HAVE_ALLOCA_H
    2.13 +#  include <alloca.h>
    2.14 +# elif __GNUC__
    2.15 +#  define alloca __builtin_alloca
    2.16 +# elif _MSC_VER
    2.17  #  include <malloc.h>
    2.18  #  define alloca _alloca
    2.19 +# elif _AIX
    2.20 +  #pragma alloca
    2.21  # else
    2.22 -#  if HAVE_ALLOCA_H
    2.23 -#   include <alloca.h>
    2.24 -#  else
    2.25 -#   ifdef _AIX
    2.26 - #pragma alloca
    2.27 -#   else
    2.28 -#    ifndef alloca /* predefined by HP cc +Olibcalls */
    2.29 -char *alloca ();
    2.30 -#    endif
    2.31 -#   endif
    2.32 +#  ifndef alloca /* predefined by HP cc +Olibcalls */
    2.33 +    char *alloca ();
    2.34  #  endif
    2.35  # endif
    2.36  #endif