From ae046a11eeef1a4c69c2fc3e64dc9160d88b1428 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 2 Aug 2009 12:54:59 +0000 Subject: [PATCH] Better check which includes #define used in stdint.h --- include/SDL_config.h.in | 3 +++ include/SDL_config_dreamcast.h | 4 ++-- include/SDL_config_iphoneos.h | 4 ++-- include/SDL_config_minimal.h | 4 ++-- include/SDL_config_nintendods.h | 4 ++-- include/SDL_config_os2.h | 4 ++-- include/SDL_config_win32.h | 4 ++-- 7 files changed, 15 insertions(+), 12 deletions(-) diff --git a/include/SDL_config.h.in b/include/SDL_config.h.in index 7c773a802..e6b4e037b 100644 --- a/include/SDL_config.h.in +++ b/include/SDL_config.h.in @@ -39,6 +39,7 @@ #undef volatile /* C datatypes */ +#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H) #undef size_t #undef int8_t #undef uint8_t @@ -49,6 +50,8 @@ #undef int64_t #undef uint64_t #undef uintptr_t +#endif /* !_STDINT_H_ && !HAVE_STDINT_H */ + #undef SIZEOF_VOIDP #undef SDL_HAS_64BIT_TYPE diff --git a/include/SDL_config_dreamcast.h b/include/SDL_config_dreamcast.h index 03b56c0c4..0196bb1cf 100644 --- a/include/SDL_config_dreamcast.h +++ b/include/SDL_config_dreamcast.h @@ -27,7 +27,7 @@ /* This is a set of defines to configure the SDL features */ -#ifndef HAVE_STDINT_H +#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H) typedef signed char int8_t; typedef unsigned char uint8_t; typedef signed short int16_t; @@ -37,7 +37,7 @@ typedef unsigned int uint32_t; typedef signed long long int64_t; typedef unsigned long long uint64_t; typedef unsigned long uintptr_t; -#endif /* !HAVE_STDINT_H */ +#endif /* !_STDINT_H_ && !HAVE_STDINT_H */ #define SIZEOF_VOIDP 4 #define SDL_HAS_64BIT_TYPE 1 diff --git a/include/SDL_config_iphoneos.h b/include/SDL_config_iphoneos.h index b3ee2bb3c..a2101cd59 100644 --- a/include/SDL_config_iphoneos.h +++ b/include/SDL_config_iphoneos.h @@ -25,7 +25,7 @@ #include "SDL_platform.h" -#ifndef HAVE_STDINT_H +#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H) typedef signed char int8_t; typedef unsigned char uint8_t; typedef signed short int16_t; @@ -33,7 +33,7 @@ typedef unsigned short uint16_t; typedef signed int int32_t; typedef unsigned int uint32_t; typedef unsigned long uintptr_t; -#endif /* !HAVE_STDINT_H */ +#endif /* !_STDINT_H_ && !HAVE_STDINT_H */ #define SDL_HAS_64BIT_TYPE 1 diff --git a/include/SDL_config_minimal.h b/include/SDL_config_minimal.h index 0a0a70184..fbfe85649 100644 --- a/include/SDL_config_minimal.h +++ b/include/SDL_config_minimal.h @@ -29,7 +29,7 @@ #include -#ifndef HAVE_STDINT_H +#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H) typedef signed char int8_t; typedef unsigned char uint8_t; typedef signed short int16_t; @@ -38,7 +38,7 @@ typedef signed int int32_t; typedef unsigned int uint32_t; typedef unsigned int size_t; typedef unsigned long uintptr_t; -#endif /* !HAVE_STDINT_H */ +#endif /* !_STDINT_H_ && !HAVE_STDINT_H */ /* Enable the dummy audio driver (src/audio/dummy/\*.c) */ #define SDL_AUDIO_DRIVER_DUMMY 1 diff --git a/include/SDL_config_nintendods.h b/include/SDL_config_nintendods.h index b3f0735c4..2a02ba2f6 100644 --- a/include/SDL_config_nintendods.h +++ b/include/SDL_config_nintendods.h @@ -27,7 +27,7 @@ /* This is a set of defines to configure the SDL features */ -#ifndef HAVE_STDINT_H +#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H) typedef signed char int8_t; typedef unsigned char uint8_t; typedef signed short int16_t; @@ -44,7 +44,7 @@ typedef unsigned long uintptr_t; #else typedef unsigned __PTRDIFF_TYPE__ uintptr_t; #endif -#endif /* !HAVE_STDINT_H */ +#endif /* !_STDINT_H_ && !HAVE_STDINT_H */ #define SDL_HAS_64BIT_TYPE 1 diff --git a/include/SDL_config_os2.h b/include/SDL_config_os2.h index 2b2fc941b..60d614822 100644 --- a/include/SDL_config_os2.h +++ b/include/SDL_config_os2.h @@ -27,7 +27,7 @@ /* This is a set of defines to configure the SDL features */ -#ifndef HAVE_STDINT_H +#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H) typedef signed char int8_t; typedef unsigned char uint8_t; typedef signed short int16_t; @@ -38,7 +38,7 @@ typedef unsigned int size_t; typedef unsigned long uintptr_t; typedef signed long long int64_t; typedef unsigned long long uint64_t; -#endif /* !HAVE_STDINT_H */ +#endif /* !_STDINT_H_ && !HAVE_STDINT_H */ #define SIZEOF_VOIDP 4 #define SDL_HAS_64BIT_TYPE 1 diff --git a/include/SDL_config_win32.h b/include/SDL_config_win32.h index da6243cb9..1b948c099 100644 --- a/include/SDL_config_win32.h +++ b/include/SDL_config_win32.h @@ -27,7 +27,7 @@ /* This is a set of defines to configure the SDL features */ -#ifndef HAVE_STDINT_H +#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H) #if defined(__GNUC__) || defined(__DMC__) #define HAVE_STDINT_H 1 #elif defined(_MSC_VER) @@ -69,7 +69,7 @@ typedef unsigned int size_t; #endif typedef unsigned int uintptr_t; #endif /* __GNUC__ || _MSC_VER */ -#endif /* !HAVE_STDINT_H */ +#endif /* !_STDINT_H_ && !HAVE_STDINT_H */ #ifdef _WIN64 # define SIZEOF_VOIDP 8