Browse Source

Get C++ and C compilers working

pull/5232/head
Saksham Goyal 2 days ago
parent
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. +1
    -0
      .gitignore
  2. +1
    -9
      src/external/win32_clipboard.h
  3. +5
    -3
      src/platforms/rcore_desktop_glfw.c
  4. +7
    -1
      src/rcore.c

+ 1
- 0
.gitignore View File

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

+ 1
- 9
src/external/win32_clipboard.h View File

@ -13,7 +13,7 @@ unsigned char* Win32GetClipboardImageData(int* width, int* height, unsigned long
#include <stdlib.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.
#if !defined(_X86_) && !defined(_68K_) && !defined(_MPPC_) && !defined(_IA64_) && !defined(_AMD64_) && !defined(_ARM_) && !defined(_ARM64_) && !defined(_ARM64EC_) && defined(_M_IX86)
#define _X86_
@ -92,13 +92,6 @@ unsigned char* Win32GetClipboardImageData(int* width, int* height, unsigned long
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)
@ -371,4 +364,3 @@ static int GetPixelDataOffset(BITMAPINFOHEADER bih)
}
#endif // WIN32_CLIPBOARD_IMPLEMENTATION
// EOF

+ 5
- 3
src/platforms/rcore_desktop_glfw.c View File

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

+ 7
- 1
src/rcore.c View File

@ -519,8 +519,14 @@ static void RecordAutomationEvent(void); // Record frame events (to internal eve
#endif
#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)
__declspec(dllimport) void __stdcall Sleep(unsigned long msTimeout); // Required for: WaitTime()
#ifdef __cplusplus
}
#endif
#endif
#if !defined(SUPPORT_MODULE_RTEXT)
@ -2522,7 +2528,7 @@ int MakeDirectory(const char *dirPath)
// Create final directory
if (!DirectoryExists(pathcpy)) MKDIR(pathcpy);
RL_FREE(pathcpy);
// In case something failed and requested directory
// was not successfully created, return -1
if (!DirectoryExists(dirPath)) return -1;

Loading…
Cancel
Save