Skip to content

Commit d1bffb8

Browse files
icculusthatcosmonaut
authored andcommitted
stdinc: define SDL_NOLONGLONG for old Visual Studios, document the symbol.
Reference PR libsdl-org#11900.
1 parent 3b44694 commit d1bffb8

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

include/SDL3/SDL_stdinc.h

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,32 @@ void *alloca(size_t);
107107
# endif
108108
#endif
109109

110+
111+
#ifdef SDL_WIKI_DOCUMENTATION_SECTION
112+
113+
/**
114+
* Don't let SDL use "long long" C types.
115+
*
116+
* SDL will define this if it believes the compiler doesn't understand
117+
* the "long long" syntax for C datatypes. This can happen on older compilers.
118+
*
119+
* If _your_ compiler doesn't support "long long" but SDL doesn't know it, it
120+
* is safe to define this yourself to build against the SDL headers.
121+
*
122+
* If this is defined, it will remove access to some C runtime support
123+
* functions, like SDL_ulltoa and SDL_strtoll that refer to this datatype
124+
* explicitly. The rest of SDL will still be available.
125+
*
126+
* SDL's own source code cannot be built with a compiler that has this defined,
127+
* for various technical reasons.
128+
*/
129+
#define SDL_NOLONGLONG 1
130+
131+
#elif defined(_MSC_VER) && (_MSC_VER < 1310) /* long long introduced in Visual Studio.NET 2003 */
132+
# define SDL_NOLONGLONG 1
133+
#endif
134+
135+
110136
#ifdef SDL_WIKI_DOCUMENTATION_SECTION
111137

112138
/**

0 commit comments

Comments
 (0)