Skip to content

Commit f622021

Browse files
remove #define RGFWDEF and make the #undefs only happen for their OS (RGFW) (#3971)
* Fix Makefile issues (RGFW) (linux) (macOS) * Do not use nanosleep on windows at all (PLATFORM_DESKTOP_RGFW) * remove #define RGFWDEF and make the #undefs only happen for their OS
1 parent 8a5fd3a commit f622021

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

src/platforms/rcore_desktop_rgfw.c

+18-7
Original file line numberDiff line numberDiff line change
@@ -55,35 +55,46 @@
5555
void ShowCursor(void);
5656
void CloseWindow(void);
5757

58+
#ifdef __linux__
5859
#define _INPUT_EVENT_CODES_H
59-
#define _APISETSTRING_
60-
#define RGFWDEF
60+
#endif
61+
62+
#if defined(__unix__) || defined(__linux__)
6163
#define _XTYPEDEF_FONT
64+
#endif
65+
6266
#define RGFW_IMPLEMENTATION
6367

68+
#if defined(__WIN32) || defined(__WIN64)
6469
#define WIN32_LEAN_AND_MEAN
6570
#define Rectangle rectangle_win32
6671
#define CloseWindow CloseWindow_win32
6772
#define ShowCursor __imp_ShowCursor
73+
#define _APISETSTRING_
74+
#endif
6875

76+
#ifdef __APPLE__
6977
#define Point NSPOINT
7078
#define Size NSSIZE
79+
#endif
7180

7281
#ifdef _MSC_VER
7382
__declspec(dllimport) int __stdcall MultiByteToWideChar(unsigned int CodePage, unsigned long dwFlags, const char* lpMultiByteStr, int cbMultiByte, wchar_t* lpWideCharStr, int cchWideChar);
7483
#endif
7584

7685
#include "../external/RGFW.h"
86+
87+
#if defined(__WIN32) || defined(__WIN64)
7788
#undef DrawText
7889
#undef ShowCursor
7990
#undef CloseWindow
91+
#undef Rectangle
92+
#endif
93+
94+
#ifdef __APPLE__
8095
#undef Point
8196
#undef Size
82-
83-
#define Rectangle struct Rectangle
84-
void CloseWindow(void);
85-
void ShowCursor(void);
86-
97+
#endif
8798

8899
#include <stdbool.h>
89100

0 commit comments

Comments
 (0)