Skip to content

Commit d8861cc

Browse files
authored
change defined() to 0/1 check (#5599)
1 parent c686e08 commit d8861cc

7 files changed

Lines changed: 18 additions & 18 deletions

File tree

src/config.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@
8585
// However, it can also reduce overall system performance, because the thread scheduler switches tasks more often
8686
#define SUPPORT_WINMM_HIGHRES_TIMER 1
8787
#endif
88-
#if !defined(SUPPORT_BUSY_WAIT_LOOP) && !SUPPORT_PARTIALBUSY_WAIT_LOOP
88+
#if !SUPPORT_BUSY_WAIT_LOOP && !SUPPORT_PARTIALBUSY_WAIT_LOOP
8989
// Use busy wait loop for timing sync, if not defined, a high-resolution timer is set up and used
9090
#define SUPPORT_BUSY_WAIT_LOOP 0 // Disabled by default
9191
#endif
92-
#if !defined(SUPPORT_PARTIALBUSY_WAIT_LOOP) && !SUPPORT_BUSY_WAIT_LOOP
92+
#if !SUPPORT_PARTIALBUSY_WAIT_LOOP && !SUPPORT_BUSY_WAIT_LOOP
9393
// Use a partial-busy wait loop, in this case frame sleeps for most of the time,
9494
// but then runs a busy loop at the end for accuracy
9595
#define SUPPORT_PARTIALBUSY_WAIT_LOOP 1

src/platforms/rcore_desktop_glfw.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2049,7 +2049,7 @@ static void MouseButtonCallback(GLFWwindow *window, int button, int action, int
20492049
CORE.Input.Mouse.currentButtonState[button] = action;
20502050
CORE.Input.Touch.currentTouchState[button] = action;
20512051

2052-
#if SUPPORT_GESTURES_SYSTEM && defined(SUPPORT_MOUSE_GESTURES)
2052+
#if SUPPORT_GESTURES_SYSTEM && SUPPORT_MOUSE_GESTURES
20532053
// Process mouse events as touches to be able to use mouse-gestures
20542054
GestureEvent gestureEvent = { 0 };
20552055

@@ -2084,7 +2084,7 @@ static void MouseCursorPosCallback(GLFWwindow *window, double x, double y)
20842084
CORE.Input.Mouse.currentPosition.y = (float)y;
20852085
CORE.Input.Touch.position[0] = CORE.Input.Mouse.currentPosition;
20862086

2087-
#if SUPPORT_GESTURES_SYSTEM && defined(SUPPORT_MOUSE_GESTURES)
2087+
#if SUPPORT_GESTURES_SYSTEM && SUPPORT_MOUSE_GESTURES
20882088
// Process mouse events as touches to be able to use mouse-gestures
20892089
GestureEvent gestureEvent = { 0 };
20902090

src/platforms/rcore_desktop_rgfw.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,7 @@ const char *GetClipboardText(void)
992992
return RGFW_readClipboard(NULL);
993993
}
994994

995-
#if defined(SUPPORT_CLIPBOARD_IMAGE)
995+
#if SUPPORT_CLIPBOARD_IMAGE
996996
#if defined(_WIN32)
997997
#define WIN32_CLIPBOARD_IMPLEMENTATION
998998
#define WINUSER_ALREADY_INCLUDED
@@ -1006,7 +1006,7 @@ const char *GetClipboardText(void)
10061006
Image GetClipboardImage(void)
10071007
{
10081008
Image image = { 0 };
1009-
#if defined(SUPPORT_CLIPBOARD_IMAGE)
1009+
#if SUPPORT_CLIPBOARD_IMAGE
10101010
#if defined(_WIN32)
10111011
unsigned long long int dataSize = 0; // moved into _WIN32 scope until other platforms gain support
10121012
void *fileData = NULL; // moved into _WIN32 scope until other platforms gain support
@@ -1142,7 +1142,7 @@ const char *GetKeyName(int key)
11421142
// Register all input events
11431143
void PollInputEvents(void)
11441144
{
1145-
#if defined(SUPPORT_GESTURES_SYSTEM)
1145+
#if SUPPORT_GESTURES_SYSTEM
11461146
// NOTE: Gestures update must be called every frame to reset gestures correctly
11471147
// because ProcessGestureEvent() is just called on an event, not every frame
11481148
UpdateGestures();
@@ -1408,7 +1408,7 @@ void PollInputEvents(void)
14081408
default: break;
14091409
}
14101410

1411-
#if defined(SUPPORT_GESTURES_SYSTEM)
1411+
#if SUPPORT_GESTURES_SYSTEM
14121412
if (touchAction > -1)
14131413
{
14141414
// Process mouse events as touches to be able to use mouse-gestures

src/platforms/rcore_template.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ const char *GetKeyName(int key)
405405
// Register all input events
406406
void PollInputEvents(void)
407407
{
408-
#if defined(SUPPORT_GESTURES_SYSTEM)
408+
#if SUPPORT_GESTURES_SYSTEM
409409
// NOTE: Gestures update must be called every frame to reset gestures correctly
410410
// because ProcessGestureEvent() is just called on an event, not every frame
411411
UpdateGestures();

src/platforms/rcore_web.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1564,7 +1564,7 @@ static void MouseButtonCallback(GLFWwindow *window, int button, int action, int
15641564
CORE.Input.Mouse.currentButtonState[button] = action;
15651565
CORE.Input.Touch.currentTouchState[button] = action;
15661566

1567-
#if SUPPORT_GESTURES_SYSTEM && defined(SUPPORT_MOUSE_GESTURES)
1567+
#if SUPPORT_GESTURES_SYSTEM && SUPPORT_MOUSE_GESTURES
15681568
// Process mouse events as touches to be able to use mouse-gestures
15691569
GestureEvent gestureEvent = { 0 };
15701570

@@ -1605,7 +1605,7 @@ static void MouseMoveCallback(GLFWwindow *window, double x, double y)
16051605
CORE.Input.Touch.position[0] = CORE.Input.Mouse.currentPosition;
16061606
}
16071607

1608-
#if SUPPORT_GESTURES_SYSTEM && defined(SUPPORT_MOUSE_GESTURES)
1608+
#if SUPPORT_GESTURES_SYSTEM && SUPPORT_MOUSE_GESTURES
16091609
// Process mouse events as touches to be able to use mouse-gestures
16101610
GestureEvent gestureEvent = { 0 };
16111611

src/platforms/rcore_web_emscripten.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1457,7 +1457,7 @@ static EM_BOOL EmscriptenMouseCallback(int eventType, const EmscriptenMouseEvent
14571457
default: break;
14581458
}
14591459

1460-
#if SUPPORT_GESTURES_SYSTEM && defined(SUPPORT_MOUSE_GESTURES)
1460+
#if SUPPORT_GESTURES_SYSTEM && SUPPORT_MOUSE_GESTURES
14611461
// Process mouse events as touches to be able to use mouse-gestures
14621462
GestureEvent gestureEvent = { 0 };
14631463

@@ -1529,7 +1529,7 @@ static EM_BOOL EmscriptenMouseMoveCallback(int eventType, const EmscriptenMouseE
15291529
CORE.Input.Touch.position[0] = CORE.Input.Mouse.currentPosition;
15301530
}
15311531

1532-
#if SUPPORT_GESTURES_SYSTEM && defined(SUPPORT_MOUSE_GESTURES)
1532+
#if SUPPORT_GESTURES_SYSTEM && SUPPORT_MOUSE_GESTURES
15331533
// Process mouse events as touches to be able to use mouse-gestures
15341534
GestureEvent gestureEvent = { 0 };
15351535

src/rtextures.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,11 @@
150150
#endif
151151
#endif
152152

153-
#if (defined(SUPPORT_FILEFORMAT_DDS) || \
154-
defined(SUPPORT_FILEFORMAT_PKM) || \
155-
defined(SUPPORT_FILEFORMAT_KTX) || \
156-
defined(SUPPORT_FILEFORMAT_PVR) || \
157-
defined(SUPPORT_FILEFORMAT_ASTC))
153+
#if (SUPPORT_FILEFORMAT_DDS || \
154+
SUPPORT_FILEFORMAT_PKM || \
155+
SUPPORT_FILEFORMAT_KTX || \
156+
SUPPORT_FILEFORMAT_PVR || \
157+
SUPPORT_FILEFORMAT_ASTC)
158158

159159
#if defined(__GNUC__) // GCC and Clang
160160
#pragma GCC diagnostic push

0 commit comments

Comments
 (0)