From a4e7fcef71f32122a3a7b95d35dc471f04a7c803 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 18 Feb 2006 06:51:00 +0000 Subject: [PATCH] More fixes for building on BeOS --- include/SDL_endian.h | 7 ++++--- include/SDL_stdinc.h | 24 ++++++++++-------------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/include/SDL_endian.h b/include/SDL_endian.h index 1d24f5a44..dba30ad17 100644 --- a/include/SDL_endian.h +++ b/include/SDL_endian.h @@ -52,12 +52,13 @@ extern "C" { #endif -/* Use inline functions for compilers that support them, and static +/* Use __inline__ functions for compilers that support them, and static functions for those that do not. Because these functions become - static for compilers that do not support inline functions, this + static for compilers that do not support __inline__ functions, this header should only be included in files that actually use them. */ -#if defined(__GNUC__) && defined(__i386__) +#if defined(__GNUC__) && defined(__i386__) && + !(__GNUC__ == 2 && __GNUC_MINOR__ == 95 /* broken gcc version */) static __inline__ Uint16 SDL_Swap16(Uint16 x) { __asm__("xchgb %b0,%h0" : "=q" (x) : "0" (x)); diff --git a/include/SDL_stdinc.h b/include/SDL_stdinc.h index 2e5c5e2c4..090433d65 100644 --- a/include/SDL_stdinc.h +++ b/include/SDL_stdinc.h @@ -28,23 +28,19 @@ #include "SDL_config.h" /* AIX requires this to be the first thing in the file. */ -#ifdef __GNUC__ -# define alloca __builtin_alloca -#else -# ifdef _MSC_VER +#if HAVE_ALLOCA +# if HAVE_ALLOCA_H +# include +# elif __GNUC__ +# define alloca __builtin_alloca +# elif _MSC_VER # include # define alloca _alloca +# elif _AIX + #pragma alloca # else -# if HAVE_ALLOCA_H -# include -# else -# ifdef _AIX - #pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -char *alloca (); -# endif -# endif +# ifndef alloca /* predefined by HP cc +Olibcalls */ + char *alloca (); # endif # endif #endif