Skip to content

Commit d88a95c

Browse files
committed
Get C++ and C compilers working
1 parent 6d18245 commit d88a95c

File tree

4 files changed

+14
-13
lines changed

4 files changed

+14
-13
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ packages/
5555
*.so
5656
*.so.*
5757
*.dll
58+
*.obj
5859

5960
# Emscripten
6061
emsdk

src/external/win32_clipboard.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ unsigned char* Win32GetClipboardImageData(int* width, int* height, unsigned long
1313
#include <stdlib.h>
1414
#include <assert.h>
1515

16-
// NOTE: These search for architecture is taken from "Windows.h", and it's necessary if we really don't wanna import windows.h
16+
// NOTE: These search for architecture is taken from "Windows.h", and it's necessary if we really don't wanna import windows.h
1717
// 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.
1818
#if !defined(_X86_) && !defined(_68K_) && !defined(_MPPC_) && !defined(_IA64_) && !defined(_AMD64_) && !defined(_ARM_) && !defined(_ARM64_) && !defined(_ARM64EC_) && defined(_M_IX86)
1919
#define _X86_
@@ -92,13 +92,6 @@ unsigned char* Win32GetClipboardImageData(int* width, int* height, unsigned long
9292

9393
typedef int WINBOOL;
9494

95-
// typedef HANDLE HGLOBAL;
96-
97-
#if !defined(HWND) && !defined(_MSC_VER)
98-
#define HWND void*
99-
#else
100-
typedef struct HWND__ *HWND;
101-
#endif
10295

10396

10497
#if !defined(_WINUSER_) || !defined(WINUSER_ALREADY_INCLUDED)
@@ -371,4 +364,3 @@ static int GetPixelDataOffset(BITMAPINFOHEADER bih)
371364
}
372365
#endif // WIN32_CLIPBOARD_IMPLEMENTATION
373366
// EOF
374-

src/platforms/rcore_desktop_glfw.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,12 @@
5656

5757
// Support retrieving native window handlers
5858
#if defined(_WIN32)
59-
typedef void *PVOID;
60-
typedef PVOID HANDLE;
59+
#if !defined(HWND) && !defined(_MSVC_LANG)
60+
#define HWND void*
61+
#elif !defined(HWND) && defined(_MSVC_LANG)
62+
typedef struct HWND__ *HWND;
63+
#endif
6164
#include "../external/win32_clipboard.h"
62-
typedef HANDLE HWND;
6365
#define GLFW_EXPOSE_NATIVE_WIN32
6466
#define GLFW_NATIVE_INCLUDE_NONE // To avoid some symbols re-definition in windows.h
6567
#include "GLFW/glfw3native.h"

src/rcore.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,8 +519,14 @@ static void RecordAutomationEvent(void); // Record frame events (to internal eve
519519
#endif
520520

521521
#if defined(_WIN32) && !defined(PLATFORM_DESKTOP_RGFW)
522+
#ifdef __cplusplus
523+
extern "C" {
524+
#endif
522525
// NOTE: We declare Sleep() function symbol to avoid including windows.h (kernel32.lib linkage required)
523526
__declspec(dllimport) void __stdcall Sleep(unsigned long msTimeout); // Required for: WaitTime()
527+
#ifdef __cplusplus
528+
}
529+
#endif
524530
#endif
525531

526532
#if !defined(SUPPORT_MODULE_RTEXT)
@@ -2522,7 +2528,7 @@ int MakeDirectory(const char *dirPath)
25222528
// Create final directory
25232529
if (!DirectoryExists(pathcpy)) MKDIR(pathcpy);
25242530
RL_FREE(pathcpy);
2525-
2531+
25262532
// In case something failed and requested directory
25272533
// was not successfully created, return -1
25282534
if (!DirectoryExists(dirPath)) return -1;

0 commit comments

Comments
 (0)