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
This commit is contained in:
Colleague Riley
2024-05-10 15:09:22 -04:00
committed by GitHub
parent 8a5fd3ac1d
commit f62202198e

View File

@@ -55,35 +55,46 @@
void ShowCursor(void); void ShowCursor(void);
void CloseWindow(void); void CloseWindow(void);
#ifdef __linux__
#define _INPUT_EVENT_CODES_H #define _INPUT_EVENT_CODES_H
#define _APISETSTRING_ #endif
#define RGFWDEF
#if defined(__unix__) || defined(__linux__)
#define _XTYPEDEF_FONT #define _XTYPEDEF_FONT
#endif
#define RGFW_IMPLEMENTATION #define RGFW_IMPLEMENTATION
#if defined(__WIN32) || defined(__WIN64)
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#define Rectangle rectangle_win32 #define Rectangle rectangle_win32
#define CloseWindow CloseWindow_win32 #define CloseWindow CloseWindow_win32
#define ShowCursor __imp_ShowCursor #define ShowCursor __imp_ShowCursor
#define _APISETSTRING_
#endif
#ifdef __APPLE__
#define Point NSPOINT #define Point NSPOINT
#define Size NSSIZE #define Size NSSIZE
#endif
#ifdef _MSC_VER #ifdef _MSC_VER
__declspec(dllimport) int __stdcall MultiByteToWideChar(unsigned int CodePage, unsigned long dwFlags, const char* lpMultiByteStr, int cbMultiByte, wchar_t* lpWideCharStr, int cchWideChar); __declspec(dllimport) int __stdcall MultiByteToWideChar(unsigned int CodePage, unsigned long dwFlags, const char* lpMultiByteStr, int cbMultiByte, wchar_t* lpWideCharStr, int cchWideChar);
#endif #endif
#include "../external/RGFW.h" #include "../external/RGFW.h"
#if defined(__WIN32) || defined(__WIN64)
#undef DrawText #undef DrawText
#undef ShowCursor #undef ShowCursor
#undef CloseWindow #undef CloseWindow
#undef Rectangle
#endif
#ifdef __APPLE__
#undef Point #undef Point
#undef Size #undef Size
#endif
#define Rectangle struct Rectangle
void CloseWindow(void);
void ShowCursor(void);
#include <stdbool.h> #include <stdbool.h>