Skip to content

Commit

Permalink
add more stl
Browse files Browse the repository at this point in the history
  • Loading branch information
ColleagueRiley committed Jan 6, 2025
1 parent 0076937 commit 6206cf5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 2 additions & 14 deletions RGFW.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,6 @@ int main() {
#ifndef RGFW_MEMCPY
#include <string.h>

#ifdef RGFW_WINDOWS
#include <wchar.h>
#include <locale.h>
#endif

#define RGFW_MEMCPY(dist, src, len) memcpy(dist, src, len)
#define RGFW_STRNCMP(s1, s2, max) strncmp(s1, s2, max)
//required for X11
Expand Down Expand Up @@ -5303,7 +5298,8 @@ char* RGFW_readClipboard(size_t* size) {
#include <windowsx.h>
#include <shellapi.h>
#include <shellscalingapi.h>

#include <wchar.h>
#include <locale.h>
#include <winuser.h>

__declspec(dllimport) int __stdcall WideCharToMultiByte( UINT CodePage, DWORD dwFlags, const WCHAR* lpWideCharStr, int cchWideChar, LPSTR lpMultiByteStr, int cbMultiByte, LPCCH lpDefaultChar, LPBOOL lpUsedDefaultChar);
Expand Down Expand Up @@ -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");


Expand All @@ -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 */
Expand Down
5 changes: 0 additions & 5 deletions examples/nostl/nostl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 6206cf5

Please sign in to comment.