Skip to content

Commit

Permalink
add nostl
Browse files Browse the repository at this point in the history
  • Loading branch information
ColleagueRiley committed Jan 6, 2025
1 parent 74a91d3 commit 68baff8
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
14 changes: 13 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,19 @@ else ifeq ($(detected_OS),Darwin)
else ifeq ($(CC),emcc)
$(CC) $(CFLAGS) $(WARNINGS) -I. $< $(LIBS) $(LINK_GL3) -o $@$(EXT)
else
@echo not sure what this platform is
@echo minimal_links is not supported on this platform
endif


examples/nostl/nostl: examples/nostl/nostl.c RGFW.h
ifeq ($(detected_OS),Linux)
$(CC) $(CFLAGS) $(LIBS) -nostdlib -I. $< -o $@$(EXT)
else ifeq ($(detected_OS),windows)
$(CC) $(CFLAGS) $(WARNINGS) -nostdlib -I. $< -lgdi32 -o $@$(EXT)
else ifeq ($(detected_OS),Darwin)
$(CC) $(CFLAGS) $(WARNINGS) -nostdlib -I. $< -framework Foundation -framework AppKit -o $@$(EXT)
else ifeq ($(CC),emcc)
@echo nostl is not supported on this platform
endif


Expand Down
2 changes: 0 additions & 2 deletions RGFW.h
Original file line number Diff line number Diff line change
Expand Up @@ -9241,8 +9241,6 @@ void EMSCRIPTEN_KEEPALIVE RGFW_writeFile(const char *path, const char *data, siz
RGFW_window* RGFW_createWindow(const char* name, RGFW_rect rect, RGFW_windowArgs args) {
RGFW_UNUSED(name);

RGFW_UNUSED(RGFW_initFormatAttribs);

RGFW_window* win = RGFW_window_basic_init(rect, args);

#ifndef RGFW_WEBGPU
Expand Down
16 changes: 16 additions & 0 deletions examples/nostl/nostl.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#define RGFW_IMPLEMENTATION
#define RGFW_NO_THREADS

#include "RGFW.h"

int main(void) {
RGFW_window* win = RGFW_createWindow("no standard library", RGFW_RECT(0, 0, 200, 100), (u16)(RGFW_center));

while (RGFW_window_shouldClose(win) == RGFW_FALSE) {
while (RGFW_window_checkEvent(win))

RGFW_window_swapBuffers(win);
}

RGFW_window_close(win);
}

0 comments on commit 68baff8

Please sign in to comment.