Go to the documentation of this file.
31#ifdef SDL_begin_code_h
32#error Nested inclusion of SDL_begin_code.h
34#define SDL_begin_code_h
37# if defined(__GNUC__) && (__GNUC__ >= 4)
38# define SDL_DEPRECATED __attribute__((deprecated))
40# define SDL_DEPRECATED
46# define SDL_UNUSED __attribute__((unused))
54# if defined(__WIN32__) || defined(__WINRT__) || defined(__CYGWIN__) || defined(__GDK__)
56# define DECLSPEC __declspec(dllexport)
61# if defined(__GNUC__) && __GNUC__ >= 4
62# define DECLSPEC __attribute__ ((visibility("default")))
71#if (defined(__WIN32__) || defined(__WINRT__) || defined(__GDK__)) && !defined(__GNUC__)
72#define SDLCALL __cdecl
83#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__)
85#pragma warning(disable: 4103)
88#pragma clang diagnostic ignored "-Wpragma-pack"
103#define SDL_INLINE __inline__
104#elif defined(_MSC_VER) || defined(__BORLANDC__) || \
105 defined(__DMC__) || defined(__SC__) || \
106 defined(__WATCOMC__) || defined(__LCC__) || \
107 defined(__DECC) || defined(__CC_ARM)
108#define SDL_INLINE __inline
110#define __inline__ __inline
113#define SDL_INLINE inline
115#define __inline__ inline
120#ifndef SDL_FORCE_INLINE
122#define SDL_FORCE_INLINE __forceinline
123#elif ( (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__) )
124#define SDL_FORCE_INLINE __attribute__((always_inline)) static __inline__
126#define SDL_FORCE_INLINE static SDL_INLINE
132#define SDL_NORETURN __attribute__((noreturn))
133#elif defined(_MSC_VER)
134#define SDL_NORETURN __declspec(noreturn)
141#if !defined(__MACH__)
146#define NULL ((void *)0)
151#ifndef SDL_FALLTHROUGH
152#if (defined(__cplusplus) && __cplusplus >= 201703L) || \
153 (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202000L)
154#define SDL_FALLTHROUGH [[fallthrough]]
156#if defined(__has_attribute)
157#define SDL_HAS_FALLTHROUGH __has_attribute(__fallthrough__)
159#define SDL_HAS_FALLTHROUGH 0
161#if SDL_HAS_FALLTHROUGH && \
162 ((defined(__GNUC__) && __GNUC__ >= 7) || \
163 (defined(__clang_major__) && __clang_major__ >= 10))
164#define SDL_FALLTHROUGH __attribute__((__fallthrough__))
166#define SDL_FALLTHROUGH do {} while (0)
168#undef SDL_HAS_FALLTHROUGH
173#if defined(__GNUC__) && (__GNUC__ >= 3)
174#define SDL_MALLOC __attribute__((malloc))
184#ifndef SDL_ALLOC_SIZE
185#if (defined(__clang__) && __clang_major__ >= 4) || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)))
186#define SDL_ALLOC_SIZE(p) __attribute__((alloc_size(p)))
187#elif defined(_MSC_VER)
188#define SDL_ALLOC_SIZE(p)
190#define SDL_ALLOC_SIZE(p)
194#ifndef SDL_ALLOC_SIZE2
195#if (defined(__clang__) && __clang_major__ >= 4) || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)))
196#define SDL_ALLOC_SIZE2(p1, p2) __attribute__((alloc_size(p1, p2)))
197#elif defined(_MSC_VER)
198#define SDL_ALLOC_SIZE2(p1, p2)
200#define SDL_ALLOC_SIZE2(p1, p2)