Get C++ and C compilers working

This commit is contained in:
Saksham Goyal 2025-10-09 13:48:44 -04:00
parent 6d18245961
commit d88a95cd83
No known key found for this signature in database
GPG Key ID: 287D96BB5977A168
4 changed files with 14 additions and 13 deletions

1
.gitignore vendored
View File

@ -55,6 +55,7 @@ packages/
*.so *.so
*.so.* *.so.*
*.dll *.dll
*.obj
# Emscripten # Emscripten
emsdk emsdk

View File

@ -13,7 +13,7 @@ unsigned char* Win32GetClipboardImageData(int* width, int* height, unsigned long
#include <stdlib.h> #include <stdlib.h>
#include <assert.h> #include <assert.h>
// NOTE: These search for architecture is taken from "Windows.h", and it's necessary if we really don't wanna import windows.h // NOTE: These search for architecture is taken from "Windows.h", and it's necessary if we really don't wanna import windows.h
// and still make it compile on msvc, because import indirectly importing "winnt.h" (e.g. <minwindef.h>) can cause problems is these are not defined. // and still make it compile on msvc, because import indirectly importing "winnt.h" (e.g. <minwindef.h>) can cause problems is these are not defined.
#if !defined(_X86_) && !defined(_68K_) && !defined(_MPPC_) && !defined(_IA64_) && !defined(_AMD64_) && !defined(_ARM_) && !defined(_ARM64_) && !defined(_ARM64EC_) && defined(_M_IX86) #if !defined(_X86_) && !defined(_68K_) && !defined(_MPPC_) && !defined(_IA64_) && !defined(_AMD64_) && !defined(_ARM_) && !defined(_ARM64_) && !defined(_ARM64EC_) && defined(_M_IX86)
#define _X86_ #define _X86_
@ -92,13 +92,6 @@ unsigned char* Win32GetClipboardImageData(int* width, int* height, unsigned long
typedef int WINBOOL; typedef int WINBOOL;
// typedef HANDLE HGLOBAL;
#if !defined(HWND) && !defined(_MSC_VER)
#define HWND void*
#else
typedef struct HWND__ *HWND;
#endif
#if !defined(_WINUSER_) || !defined(WINUSER_ALREADY_INCLUDED) #if !defined(_WINUSER_) || !defined(WINUSER_ALREADY_INCLUDED)
@ -371,4 +364,3 @@ static int GetPixelDataOffset(BITMAPINFOHEADER bih)
} }
#endif // WIN32_CLIPBOARD_IMPLEMENTATION #endif // WIN32_CLIPBOARD_IMPLEMENTATION
// EOF // EOF

View File

@ -56,10 +56,12 @@
// Support retrieving native window handlers // Support retrieving native window handlers
#if defined(_WIN32) #if defined(_WIN32)
typedef void *PVOID; #if !defined(HWND) && !defined(_MSVC_LANG)
typedef PVOID HANDLE; #define HWND void*
#elif !defined(HWND) && defined(_MSVC_LANG)
typedef struct HWND__ *HWND;
#endif
#include "../external/win32_clipboard.h" #include "../external/win32_clipboard.h"
typedef HANDLE HWND;
#define GLFW_EXPOSE_NATIVE_WIN32 #define GLFW_EXPOSE_NATIVE_WIN32
#define GLFW_NATIVE_INCLUDE_NONE // To avoid some symbols re-definition in windows.h #define GLFW_NATIVE_INCLUDE_NONE // To avoid some symbols re-definition in windows.h
#include "GLFW/glfw3native.h" #include "GLFW/glfw3native.h"

View File

@ -519,8 +519,14 @@ static void RecordAutomationEvent(void); // Record frame events (to internal eve
#endif #endif
#if defined(_WIN32) && !defined(PLATFORM_DESKTOP_RGFW) #if defined(_WIN32) && !defined(PLATFORM_DESKTOP_RGFW)
#ifdef __cplusplus
extern "C" {
#endif
// NOTE: We declare Sleep() function symbol to avoid including windows.h (kernel32.lib linkage required) // NOTE: We declare Sleep() function symbol to avoid including windows.h (kernel32.lib linkage required)
__declspec(dllimport) void __stdcall Sleep(unsigned long msTimeout); // Required for: WaitTime() __declspec(dllimport) void __stdcall Sleep(unsigned long msTimeout); // Required for: WaitTime()
#ifdef __cplusplus
}
#endif
#endif #endif
#if !defined(SUPPORT_MODULE_RTEXT) #if !defined(SUPPORT_MODULE_RTEXT)
@ -2522,7 +2528,7 @@ int MakeDirectory(const char *dirPath)
// Create final directory // Create final directory
if (!DirectoryExists(pathcpy)) MKDIR(pathcpy); if (!DirectoryExists(pathcpy)) MKDIR(pathcpy);
RL_FREE(pathcpy); RL_FREE(pathcpy);
// In case something failed and requested directory // In case something failed and requested directory
// was not successfully created, return -1 // was not successfully created, return -1
if (!DirectoryExists(dirPath)) return -1; if (!DirectoryExists(dirPath)) return -1;