Skip to content

Commit

Permalink
more c++ fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ColleagueRiley committed Jul 27, 2024
1 parent 15bcc9c commit 61b10db
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ STATIC =
WARNINGS = -Wall -Werror -Wstrict-prototypes -Wextra
OS_DIR = \\

ifneq (,$(filter $(CC),winegcc x86_64-w64-mingw32-gcc i686-w64-mingw32-gcc))
ifneq (,$(filter $(CC),winegcc x86_64-w64-mingw32-gcc i686-w64-mingw32-gcc x86_64-w64-mingw32-g++))
STATIC = --static
detected_OS := WindowsCross
LIB_EXT = .dll
Expand Down Expand Up @@ -77,7 +77,8 @@ ifneq (,$(filter $(CC),emcc))
LINK_GL1 = -s LEGACY_GL_EMULATION -D LEGACY_GL_EMULATION -sGL_UNSAFE_OPTS=0
LINK_GL3 = -s FULL_ES3
LINK_GL2 = -s FULL_ES2
LIBS = -s WASM=1 -s ASYNCIFY -s USE_WEBGL2 -s GL_SUPPORT_EXPLICIT_SWAP_CONTROL=1 -sEXPORTED_RUNTIME_METHODS=stringToNewUTF8
EXPORTED_JS = -s EXPORTED_RUNTIME_METHODS="['stringToNewUTF8']"
LIBS = -s WASM=1 -s ASYNCIFY -s USE_WEBGL2 -s GL_SUPPORT_EXPLICIT_SWAP_CONTROL=1 $(EXPORTED_JS)
EXT = .js
endif

Expand Down
12 changes: 7 additions & 5 deletions RGFW.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
#endif

#ifdef __cplusplus
//extern "C" {
extern "C" {
#endif
/* makes sure the header file part is only defined once by default */
Expand Down Expand Up @@ -2203,7 +2203,7 @@ Start of Linux / Unix defines
if (RGFW_bufferSize.w == 0 && RGFW_bufferSize.h == 0)
RGFW_bufferSize = RGFW_getScreenSize();

win->buffer = RGFW_MALLOC(RGFW_bufferSize.w * RGFW_bufferSize.h * 4);
win->buffer = (u8*)RGFW_MALLOC(RGFW_bufferSize.w * RGFW_bufferSize.h * 4);

#ifdef RGFW_OSMESA
win->src.ctx = OSMesaCreateContext(OSMESA_RGBA, NULL);
Expand Down Expand Up @@ -4116,8 +4116,10 @@ static HMODULE wglinstance = NULL;
#define GetDpiForMonitor GetDpiForMonitorSRC
#endif

__declspec(dllimport) u32 __stdcall timeBeginPeriod(u32 uPeriod);

extern "C" {
__declspec(dllimport) u32 __stdcall timeBeginPeriod(u32 uPeriod);
}

#ifndef RGFW_NO_XINPUT
void RGFW_loadXInput(void) {
u32 i;
Expand Down Expand Up @@ -7879,5 +7881,5 @@ RGFW_monitor RGFW_window_getMonitor(RGFW_window* win) { RGFW_UNUSED(win) return
#endif /*RGFW_IMPLEMENTATION*/

#ifdef __cplusplus
//}
}
#endif

0 comments on commit 61b10db

Please sign in to comment.