Skip to content

Commit 68baff8

Browse files
add nostl
1 parent 74a91d3 commit 68baff8

File tree

3 files changed

+29
-3
lines changed

3 files changed

+29
-3
lines changed

Makefile

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,19 @@ else ifeq ($(detected_OS),Darwin)
177177
else ifeq ($(CC),emcc)
178178
$(CC) $(CFLAGS) $(WARNINGS) -I. $< $(LIBS) $(LINK_GL3) -o $@$(EXT)
179179
else
180-
@echo not sure what this platform is
180+
@echo minimal_links is not supported on this platform
181+
endif
182+
183+
184+
examples/nostl/nostl: examples/nostl/nostl.c RGFW.h
185+
ifeq ($(detected_OS),Linux)
186+
$(CC) $(CFLAGS) $(LIBS) -nostdlib -I. $< -o $@$(EXT)
187+
else ifeq ($(detected_OS),windows)
188+
$(CC) $(CFLAGS) $(WARNINGS) -nostdlib -I. $< -lgdi32 -o $@$(EXT)
189+
else ifeq ($(detected_OS),Darwin)
190+
$(CC) $(CFLAGS) $(WARNINGS) -nostdlib -I. $< -framework Foundation -framework AppKit -o $@$(EXT)
191+
else ifeq ($(CC),emcc)
192+
@echo nostl is not supported on this platform
181193
endif
182194

183195

RGFW.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9241,8 +9241,6 @@ void EMSCRIPTEN_KEEPALIVE RGFW_writeFile(const char *path, const char *data, siz
92419241
RGFW_window* RGFW_createWindow(const char* name, RGFW_rect rect, RGFW_windowArgs args) {
92429242
RGFW_UNUSED(name);
92439243

9244-
RGFW_UNUSED(RGFW_initFormatAttribs);
9245-
92469244
RGFW_window* win = RGFW_window_basic_init(rect, args);
92479245

92489246
#ifndef RGFW_WEBGPU

examples/nostl/nostl.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#define RGFW_IMPLEMENTATION
2+
#define RGFW_NO_THREADS
3+
4+
#include "RGFW.h"
5+
6+
int main(void) {
7+
RGFW_window* win = RGFW_createWindow("no standard library", RGFW_RECT(0, 0, 200, 100), (u16)(RGFW_center));
8+
9+
while (RGFW_window_shouldClose(win) == RGFW_FALSE) {
10+
while (RGFW_window_checkEvent(win))
11+
12+
RGFW_window_swapBuffers(win);
13+
}
14+
15+
RGFW_window_close(win);
16+
}

0 commit comments

Comments
 (0)