From 6206cf5d970842cc3f3e46ad821e5957228c9c6c Mon Sep 17 00:00:00 2001 From: ColleagueRiley Date: Sun, 5 Jan 2025 21:23:04 -0500 Subject: [PATCH] add more stl --- Makefile | 2 +- RGFW.h | 16 ++-------------- examples/nostl/nostl.c | 5 ----- 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/Makefile b/Makefile index 0722a907..75b840e5 100644 --- a/Makefile +++ b/Makefile @@ -188,7 +188,7 @@ ifeq ($(CC),emcc) else ifeq ($(detected_OS),Linux) $(CC) $(CFLAGS) -fno-stack-protector -lX11 -lXcursor -lGL -lXi -lXrandr -I. $< -o $@$(EXT) else ifeq ($(detected_OS),windows) - $(CC) $(CFLAGS) $(WARNINGS) -I. $< -lkernel32 -lgdi32 -lshell32 -lUser32 -nostdlib -o $@$(EXT) + $(CC) $(CFLAGS) $(WARNINGS) -I. $< -lkernel32 -lgdi32 -lshell32 -lUser32 -o $@$(EXT) else ifeq ($(detected_OS),Darwin) $(CC) $(CFLAGS) $(WARNINGS) -nostdlib -I. $< -framework Foundation -framework AppKit -o $@$(EXT) else diff --git a/RGFW.h b/RGFW.h index a86aa663..3edbd058 100644 --- a/RGFW.h +++ b/RGFW.h @@ -196,11 +196,6 @@ int main() { #ifndef RGFW_MEMCPY #include - #ifdef RGFW_WINDOWS - #include - #include - #endif - #define RGFW_MEMCPY(dist, src, len) memcpy(dist, src, len) #define RGFW_STRNCMP(s1, s2, max) strncmp(s1, s2, max) //required for X11 @@ -5303,7 +5298,8 @@ char* RGFW_readClipboard(size_t* size) { #include #include #include - +#include +#include #include __declspec(dllimport) int __stdcall WideCharToMultiByte( UINT CodePage, DWORD dwFlags, const WCHAR* lpWideCharStr, int cchWideChar, LPSTR lpMultiByteStr, int cbMultiByte, LPCCH lpDefaultChar, LPBOOL lpUsedDefaultChar); @@ -6835,12 +6831,9 @@ char* RGFW_readClipboard(size_t* size) { } wchar_t* wstr = (wchar_t*) GlobalLock(hData); - - char text_null = '\0'; char* text; { - #ifdef LC_ALL setlocale(LC_ALL, "en_US.UTF-8"); @@ -6855,11 +6848,6 @@ char* RGFW_readClipboard(size_t* size) { if (size != NULL) *size = textLen + 1; text[textLen] = '\0'; - #else - text = &text_null; - RGFW_UNUSED(wstr); - RGFW_UNUSED(size); - #endif } /* Release the clipboard data */ diff --git a/examples/nostl/nostl.c b/examples/nostl/nostl.c index 9ec34612..17fe1761 100644 --- a/examples/nostl/nostl.c +++ b/examples/nostl/nostl.c @@ -58,12 +58,7 @@ size_t stringCompare(char* s1, char* s2, size_t size) { #define RGFW_STRTOL(str, endptr, base) 0 #include "RGFW.h" - -#ifndef RGFW_WINDOWS int main(void) { -#else -int __main(void) { -#endif RGFW_window* win = RGFW_createWindow("no standard library", RGFW_RECT(0, 0, 200, 100), (u16)(RGFW_center | RGFW_allowDND)); while (RGFW_window_shouldClose(win) == RGFW_FALSE) {