Use #ifdef/#ifndef instead of #if defined/#if \!defined
This commit is contained in:
parent
308bcbbe76
commit
b6ae281e97
129 changed files with 450 additions and 450 deletions
|
@ -53,7 +53,7 @@ on the assertion line and not in some random guts of SDL, and so each
|
|||
assert can have unique static variables associated with it.
|
||||
*/
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#ifdef _MSC_VER
|
||||
/* Don't include intrin.h here because it contains C++ code */
|
||||
extern void __cdecl __debugbreak(void);
|
||||
#define SDL_TriggerBreakpoint() __debugbreak()
|
||||
|
@ -150,7 +150,7 @@ typedef struct SDL_AssertData
|
|||
extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *data,
|
||||
const char *func,
|
||||
const char *file, int line)
|
||||
#if defined(__clang__)
|
||||
#ifdef __clang__
|
||||
#if __has_feature(attribute_analyzer_noreturn)
|
||||
__attribute__((analyzer_noreturn))
|
||||
#endif
|
||||
|
|
|
@ -99,7 +99,7 @@
|
|||
#endif /* Compiler needs structure packing set */
|
||||
|
||||
#ifndef SDL_INLINE
|
||||
#if defined(__GNUC__)
|
||||
#ifdef __GNUC__
|
||||
#define SDL_INLINE __inline__
|
||||
#elif defined(_MSC_VER) || defined(__BORLANDC__) || \
|
||||
defined(__DMC__) || defined(__SC__) || \
|
||||
|
@ -118,7 +118,7 @@
|
|||
#endif /* SDL_INLINE not defined */
|
||||
|
||||
#ifndef SDL_FORCE_INLINE
|
||||
#if defined(_MSC_VER)
|
||||
#ifdef _MSC_VER
|
||||
#define SDL_FORCE_INLINE __forceinline
|
||||
#elif ( (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__) )
|
||||
#define SDL_FORCE_INLINE __attribute__((always_inline)) static __inline__
|
||||
|
@ -128,7 +128,7 @@
|
|||
#endif /* SDL_FORCE_INLINE not defined */
|
||||
|
||||
#ifndef SDL_NORETURN
|
||||
#if defined(__GNUC__)
|
||||
#ifdef __GNUC__
|
||||
#define SDL_NORETURN __attribute__((noreturn))
|
||||
#elif defined(_MSC_VER)
|
||||
#define SDL_NORETURN __declspec(noreturn)
|
||||
|
@ -138,7 +138,7 @@
|
|||
#endif /* SDL_NORETURN not defined */
|
||||
|
||||
/* Apparently this is needed by several Windows compilers */
|
||||
#if !defined(__MACH__)
|
||||
#ifndef __MACH__
|
||||
#ifndef NULL
|
||||
#ifdef __cplusplus
|
||||
#define NULL 0
|
||||
|
@ -153,7 +153,7 @@
|
|||
(defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202000L)
|
||||
#define SDL_FALLTHROUGH [[fallthrough]]
|
||||
#else
|
||||
#if defined(__has_attribute)
|
||||
#ifdef __has_attribute
|
||||
#define SDL_HAS_FALLTHROUGH __has_attribute(__fallthrough__)
|
||||
#else
|
||||
#define SDL_HAS_FALLTHROUGH 0
|
||||
|
|
|
@ -60,13 +60,13 @@ _m_prefetch(void *__P)
|
|||
#define SDL_ALTIVEC_INTRINSICS 1
|
||||
#include <altivec.h>
|
||||
#endif
|
||||
#if !defined(SDL_DISABLE_NEON)
|
||||
# if defined(__ARM_NEON)
|
||||
#ifndef SDL_DISABLE_NEON
|
||||
# ifdef __ARM_NEON
|
||||
# define SDL_NEON_INTRINSICS 1
|
||||
# include <arm_neon.h>
|
||||
# elif defined(__WINDOWS__) || defined(__WINRT__) || defined(__GDK__)
|
||||
/* Visual Studio doesn't define __ARM_ARCH, but _M_ARM (if set, always 7), and _M_ARM64 (if set, always 1). */
|
||||
# if defined(_M_ARM)
|
||||
# ifdef _M_ARM
|
||||
# define SDL_NEON_INTRINSICS 1
|
||||
# include <armintr.h>
|
||||
# include <arm_neon.h>
|
||||
|
@ -99,7 +99,7 @@ _m_prefetch(void *__P)
|
|||
# define SDL_TARGETING(x)
|
||||
#endif
|
||||
|
||||
#if defined(__loongarch64)
|
||||
#ifdef __loongarch64
|
||||
# ifndef SDL_DISABLE_LSX
|
||||
# define SDL_LSX_INTRINSICS 1
|
||||
# include <lsxintrin.h>
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
*/
|
||||
|
||||
#ifndef SDL_MAIN_HANDLED
|
||||
#if defined(__WIN32__)
|
||||
#ifdef __WIN32__
|
||||
/* On Windows SDL provides WinMain(), which parses the command line and passes
|
||||
the arguments to your main function.
|
||||
|
||||
|
@ -253,7 +253,7 @@ extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
|
|||
|
||||
#endif /* __WINRT__ */
|
||||
|
||||
#if defined(__IOS__)
|
||||
#ifdef __IOS__
|
||||
|
||||
/* for compatibility with SDL2's function of this name */
|
||||
#define SDL_UIKitRunApp(ARGC, ARGV, MAIN_FUNC) SDL_RunApp(ARGC, ARGV, MAIN_FUNC, NULL)
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#ifndef SDL_main_impl_h_
|
||||
#define SDL_main_impl_h_
|
||||
|
||||
#if !defined(SDL_main_h_)
|
||||
#ifndef SDL_main_h_
|
||||
#error "This header should not be included directly, but only via SDL_main.h!"
|
||||
#endif
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
#ifndef __gl_h_
|
||||
#define __gl_h_
|
||||
|
||||
#if defined(USE_MGL_NAMESPACE)
|
||||
#ifdef USE_MGL_NAMESPACE
|
||||
#include <SDL3/gl_mangle.h>
|
||||
#endif
|
||||
|
||||
|
|
|
@ -28,11 +28,11 @@
|
|||
#ifndef SDL_platform_defines_h_
|
||||
#define SDL_platform_defines_h_
|
||||
|
||||
#if defined(_AIX)
|
||||
#ifdef _AIX
|
||||
#undef __AIX__
|
||||
#define __AIX__ 1
|
||||
#endif
|
||||
#if defined(__HAIKU__)
|
||||
#ifdef __HAIKU__
|
||||
#undef __HAIKU__
|
||||
#define __HAIKU__ 1
|
||||
#endif
|
||||
|
@ -40,7 +40,7 @@
|
|||
#undef __BSDI__
|
||||
#define __BSDI__ 1
|
||||
#endif
|
||||
#if defined(_arch_dreamcast)
|
||||
#ifdef _arch_dreamcast
|
||||
#undef __DREAMCAST__
|
||||
#define __DREAMCAST__ 1
|
||||
#endif
|
||||
|
@ -65,12 +65,12 @@
|
|||
#undef __LINUX__ /* do we need to do this? */
|
||||
#define __ANDROID__ 1
|
||||
#endif
|
||||
#if defined(__NGAGE__)
|
||||
#ifdef __NGAGE__
|
||||
#undef __NGAGE__
|
||||
#define __NGAGE__ 1
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#ifdef __APPLE__
|
||||
/* lets us know what version of macOS we're compiling on */
|
||||
#include <AvailabilityMacros.h>
|
||||
#include <TargetConditionals.h>
|
||||
|
@ -111,11 +111,11 @@
|
|||
#endif /* TARGET_OS_IPHONE */
|
||||
#endif /* defined(__APPLE__) */
|
||||
|
||||
#if defined(__NetBSD__)
|
||||
#ifdef __NetBSD__
|
||||
#undef __NETBSD__
|
||||
#define __NETBSD__ 1
|
||||
#endif
|
||||
#if defined(__OpenBSD__)
|
||||
#ifdef __OpenBSD__
|
||||
#undef __OPENBSD__
|
||||
#define __OPENBSD__ 1
|
||||
#endif
|
||||
|
@ -127,7 +127,7 @@
|
|||
#undef __OSF__
|
||||
#define __OSF__ 1
|
||||
#endif
|
||||
#if defined(__QNXNTO__)
|
||||
#ifdef __QNXNTO__
|
||||
#undef __QNXNTO__
|
||||
#define __QNXNTO__ 1
|
||||
#endif
|
||||
|
@ -187,7 +187,7 @@
|
|||
#endif
|
||||
#endif /* defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) */
|
||||
|
||||
#if defined(__WINDOWS__)
|
||||
#ifdef __WINDOWS__
|
||||
#undef __WIN32__
|
||||
#define __WIN32__ 1
|
||||
#endif
|
||||
|
@ -196,19 +196,19 @@
|
|||
#undef __GDK__
|
||||
#define __GDK__ 1
|
||||
#endif
|
||||
#if defined(__PSP__)
|
||||
#ifdef __PSP__
|
||||
#undef __PSP__
|
||||
#define __PSP__ 1
|
||||
#endif
|
||||
#if defined(PS2)
|
||||
#ifdef PS2
|
||||
#define __PS2__ 1
|
||||
#endif
|
||||
|
||||
#if defined(__vita__)
|
||||
#ifdef __vita__
|
||||
#define __VITA__ 1
|
||||
#endif
|
||||
|
||||
#if defined(__3DS__)
|
||||
#ifdef __3DS__
|
||||
#undef __3DS__
|
||||
#define __3DS__ 1
|
||||
#endif
|
||||
|
|
|
@ -103,7 +103,7 @@ typedef struct SDL_RWops
|
|||
Uint32 type;
|
||||
union
|
||||
{
|
||||
#if defined(__ANDROID__)
|
||||
#ifdef __ANDROID__
|
||||
struct
|
||||
{
|
||||
void *asset;
|
||||
|
|
|
@ -37,8 +37,8 @@
|
|||
#include <stdint.h>
|
||||
#include <wchar.h>
|
||||
|
||||
#if !defined(alloca)
|
||||
# if defined(HAVE_ALLOCA_H)
|
||||
#ifndef alloca
|
||||
# ifdef HAVE_ALLOCA_H
|
||||
# include <alloca.h>
|
||||
# elif defined(__GNUC__)
|
||||
# define alloca __builtin_alloca
|
||||
|
@ -309,7 +309,7 @@ typedef uint64_t Uint64;
|
|||
#define SDL_PRINTF_FORMAT_STRING
|
||||
#define SDL_SCANF_FORMAT_STRING
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#ifdef __GNUC__
|
||||
#define SDL_PRINTF_VARARG_FUNC( fmtargnumber ) __attribute__ (( format( __printf__, fmtargnumber, fmtargnumber+1 )))
|
||||
#define SDL_SCANF_VARARG_FUNC( fmtargnumber ) __attribute__ (( format( __scanf__, fmtargnumber, fmtargnumber+1 )))
|
||||
#else
|
||||
|
@ -319,7 +319,7 @@ typedef uint64_t Uint64;
|
|||
#endif /* SDL_DISABLE_ANALYZE_MACROS */
|
||||
|
||||
#ifndef SDL_COMPILE_TIME_ASSERT
|
||||
#if defined(__cplusplus)
|
||||
#ifdef __cplusplus
|
||||
#if (__cplusplus >= 201103L)
|
||||
#define SDL_COMPILE_TIME_ASSERT(name, x) static_assert(x, #x)
|
||||
#endif
|
||||
|
|
|
@ -622,7 +622,7 @@ extern DECLSPEC void SDLCALL SDL_OnApplicationDidChangeStatusBarOrientation(void
|
|||
#endif
|
||||
|
||||
/* Functions used only by GDK */
|
||||
#if defined(__GDK__)
|
||||
#ifdef __GDK__
|
||||
typedef struct XTaskQueueObject * XTaskQueueHandle;
|
||||
|
||||
/**
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
/**
|
||||
* The available subsystems based on platform
|
||||
*/
|
||||
#if !defined(SDL_DISABLE_SYSWM_PLATFORMS)
|
||||
#ifndef SDL_DISABLE_SYSWM_PLATFORMS
|
||||
|
||||
#ifndef SDL_DISABLE_SYSWM_ANDROID
|
||||
#ifdef __ANDROID__
|
||||
|
@ -227,7 +227,7 @@ struct SDL_SysWMmsg
|
|||
|
||||
union
|
||||
{
|
||||
#if defined(SDL_ENABLE_SYSWM_WINDOWS)
|
||||
#ifdef SDL_ENABLE_SYSWM_WINDOWS
|
||||
struct {
|
||||
HWND hwnd; /**< The window for the message */
|
||||
UINT msg; /**< The type of message */
|
||||
|
@ -235,7 +235,7 @@ struct SDL_SysWMmsg
|
|||
LPARAM lParam; /**< LONG message parameter */
|
||||
} win;
|
||||
#endif
|
||||
#if defined(SDL_ENABLE_SYSWM_X11)
|
||||
#ifdef SDL_ENABLE_SYSWM_X11
|
||||
struct {
|
||||
XEvent event;
|
||||
} x11;
|
||||
|
@ -260,7 +260,7 @@ struct SDL_SysWMinfo
|
|||
|
||||
union
|
||||
{
|
||||
#if defined(SDL_ENABLE_SYSWM_WINDOWS)
|
||||
#ifdef SDL_ENABLE_SYSWM_WINDOWS
|
||||
struct
|
||||
{
|
||||
HWND window; /**< The window handle */
|
||||
|
@ -268,13 +268,13 @@ struct SDL_SysWMinfo
|
|||
HINSTANCE hinstance; /**< The instance handle */
|
||||
} win;
|
||||
#endif
|
||||
#if defined(SDL_ENABLE_SYSWM_WINRT)
|
||||
#ifdef SDL_ENABLE_SYSWM_WINRT
|
||||
struct
|
||||
{
|
||||
IInspectable * window; /**< The WinRT CoreWindow */
|
||||
} winrt;
|
||||
#endif
|
||||
#if defined(SDL_ENABLE_SYSWM_X11)
|
||||
#ifdef SDL_ENABLE_SYSWM_X11
|
||||
struct
|
||||
{
|
||||
Display *display; /**< The X11 display */
|
||||
|
@ -282,7 +282,7 @@ struct SDL_SysWMinfo
|
|||
Window window; /**< The X11 window */
|
||||
} x11;
|
||||
#endif
|
||||
#if defined(SDL_ENABLE_SYSWM_COCOA)
|
||||
#ifdef SDL_ENABLE_SYSWM_COCOA
|
||||
struct
|
||||
{
|
||||
#if defined(__OBJC__) && defined(__has_feature)
|
||||
|
@ -296,7 +296,7 @@ struct SDL_SysWMinfo
|
|||
#endif
|
||||
} cocoa;
|
||||
#endif
|
||||
#if defined(SDL_ENABLE_SYSWM_UIKIT)
|
||||
#ifdef SDL_ENABLE_SYSWM_UIKIT
|
||||
struct
|
||||
{
|
||||
#if defined(__OBJC__) && defined(__has_feature)
|
||||
|
@ -313,7 +313,7 @@ struct SDL_SysWMinfo
|
|||
GLuint resolveFramebuffer; /**< The Framebuffer Object which holds the resolve color Renderbuffer, when MSAA is used. */
|
||||
} uikit;
|
||||
#endif
|
||||
#if defined(SDL_ENABLE_SYSWM_WAYLAND)
|
||||
#ifdef SDL_ENABLE_SYSWM_WAYLAND
|
||||
struct
|
||||
{
|
||||
struct wl_display *display; /**< Wayland display */
|
||||
|
@ -326,7 +326,7 @@ struct SDL_SysWMinfo
|
|||
} wl;
|
||||
#endif
|
||||
|
||||
#if defined(SDL_ENABLE_SYSWM_ANDROID)
|
||||
#ifdef SDL_ENABLE_SYSWM_ANDROID
|
||||
struct
|
||||
{
|
||||
ANativeWindow *window;
|
||||
|
@ -334,7 +334,7 @@ struct SDL_SysWMinfo
|
|||
} android;
|
||||
#endif
|
||||
|
||||
#if defined(SDL_ENABLE_SYSWM_VIVANTE)
|
||||
#ifdef SDL_ENABLE_SYSWM_VIVANTE
|
||||
struct
|
||||
{
|
||||
EGLNativeDisplayType display;
|
||||
|
@ -342,7 +342,7 @@ struct SDL_SysWMinfo
|
|||
} vivante;
|
||||
#endif
|
||||
|
||||
#if defined(SDL_ENABLE_SYSWM_KMSDRM)
|
||||
#ifdef SDL_ENABLE_SYSWM_KMSDRM
|
||||
struct
|
||||
{
|
||||
int dev_index; /**< Device index (ex: the X in /dev/dri/cardX) */
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
#include <SDL3/SDL.h>
|
||||
|
||||
#if defined(__PSP__)
|
||||
#ifdef __PSP__
|
||||
#define DEFAULT_WINDOW_WIDTH 480
|
||||
#define DEFAULT_WINDOW_HEIGHT 272
|
||||
#elif defined(__VITA__)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue