From db4e2ccbaceab0f70847bd6f3ef23c6fe68a30fb Mon Sep 17 00:00:00 2001 From: Petar Popovic Date: Thu, 24 Oct 2024 05:01:52 +0200 Subject: [PATCH] Allow redefinition of only one macro SDL_SINT64_C SDL_UINT64_C --- include/SDL3/SDL_stdinc.h | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/include/SDL3/SDL_stdinc.h b/include/SDL3/SDL_stdinc.h index 71c4073b96..2f96a9f9a6 100644 --- a/include/SDL3/SDL_stdinc.h +++ b/include/SDL3/SDL_stdinc.h @@ -256,8 +256,6 @@ void *alloca(size_t); (SDL_static_cast(Uint32, SDL_static_cast(Uint8, (C))) << 16) | \ (SDL_static_cast(Uint32, SDL_static_cast(Uint8, (D))) << 24)) -#if !(defined(SDL_SINT64_C) && defined(SDL_UINT64_C)) - #ifdef SDL_WIKI_DOCUMENTATION_SECTION /** @@ -286,21 +284,33 @@ void *alloca(size_t); */ #define SDL_UINT64_C(c) c ## ULL /* or whatever the current compiler uses. */ -#elif defined(INT64_C) +#else /* !SDL_WIKI_DOCUMENTATION_SECTION */ + +#ifndef SDL_SINT64_C +#if defined(INT64_C) #define SDL_SINT64_C(c) INT64_C(c) -#define SDL_UINT64_C(c) UINT64_C(c) #elif defined(_MSC_VER) #define SDL_SINT64_C(c) c ## i64 -#define SDL_UINT64_C(c) c ## ui64 #elif defined(__LP64__) || defined(_LP64) #define SDL_SINT64_C(c) c ## L -#define SDL_UINT64_C(c) c ## UL #else #define SDL_SINT64_C(c) c ## LL +#endif +#endif /* !SDL_SINT64_C */ + +#ifndef SDL_UINT64_C +#if defined(UINT64_C) +#define SDL_UINT64_C(c) UINT64_C(c) +#elif defined(_MSC_VER) +#define SDL_UINT64_C(c) c ## ui64 +#elif defined(__LP64__) || defined(_LP64) +#define SDL_UINT64_C(c) c ## UL +#else #define SDL_UINT64_C(c) c ## ULL #endif +#endif /* !SDL_UINT64_C */ -#endif /* !(defined(SDL_SINT64_C) && defined(SDL_UINT64_C)) */ +#endif /* !SDL_WIKI_DOCUMENTATION_SECTION */ /** * \name Basic data types