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))
39# elif defined(_MSC_VER)
40# define SDL_DEPRECATED __declspec(deprecated)
42# define SDL_DEPRECATED
48# define SDL_UNUSED __attribute__((unused))
56# if defined(__WIN32__) || defined(__WINRT__) || defined(__CYGWIN__) || defined(__GDK__)
58# define DECLSPEC __declspec(dllexport)
63# if defined(__GNUC__) && __GNUC__ >= 4
64# define DECLSPEC __attribute__ ((visibility("default")))
73#if (defined(__WIN32__) || defined(__WINRT__) || defined(__GDK__)) && !defined(__GNUC__)
74#define SDLCALL __cdecl
85#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__)
87#pragma warning(disable: 4103)
90#pragma clang diagnostic ignored "-Wpragma-pack"
105#define SDL_INLINE __inline__
106#elif defined(_MSC_VER) || defined(__BORLANDC__) || \
107 defined(__DMC__) || defined(__SC__) || \
108 defined(__WATCOMC__) || defined(__LCC__) || \
109 defined(__DECC) || defined(__CC_ARM)
110#define SDL_INLINE __inline
112#define __inline__ __inline
115#define SDL_INLINE inline
117#define __inline__ inline
122#ifndef SDL_FORCE_INLINE
124#define SDL_FORCE_INLINE __forceinline
125#elif ( (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__) )
126#define SDL_FORCE_INLINE __attribute__((always_inline)) static __inline__
128#define SDL_FORCE_INLINE static SDL_INLINE
134#define SDL_NORETURN __attribute__((noreturn))
135#elif defined(_MSC_VER)
136#define SDL_NORETURN __declspec(noreturn)
148#define NULL ((void *)0)
153#ifndef SDL_FALLTHROUGH
154#if (defined(__cplusplus) && __cplusplus >= 201703L) || \
155 (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202000L)
156#define SDL_FALLTHROUGH [[fallthrough]]
158#ifdef __has_attribute
159#define SDL_HAS_FALLTHROUGH __has_attribute(__fallthrough__)
161#define SDL_HAS_FALLTHROUGH 0
163#if SDL_HAS_FALLTHROUGH && \
164 ((defined(__GNUC__) && __GNUC__ >= 7) || \
165 (defined(__clang_major__) && __clang_major__ >= 10))
166#define SDL_FALLTHROUGH __attribute__((__fallthrough__))
168#define SDL_FALLTHROUGH do {} while (0)
170#undef SDL_HAS_FALLTHROUGH
175#if defined(__GNUC__) && (__GNUC__ >= 3)
176#define SDL_MALLOC __attribute__((malloc))
186#ifndef SDL_ALLOC_SIZE
187#if (defined(__clang__) && __clang_major__ >= 4) || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)))
188#define SDL_ALLOC_SIZE(p) __attribute__((alloc_size(p)))
189#elif defined(_MSC_VER)
190#define SDL_ALLOC_SIZE(p)
192#define SDL_ALLOC_SIZE(p)
196#ifndef SDL_ALLOC_SIZE2
197#if (defined(__clang__) && __clang_major__ >= 4) || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)))
198#define SDL_ALLOC_SIZE2(p1, p2) __attribute__((alloc_size(p1, p2)))
199#elif defined(_MSC_VER)
200#define SDL_ALLOC_SIZE2(p1, p2)
202#define SDL_ALLOC_SIZE2(p1, p2)