diff --git a/scripts/build_sokol_demo.sh b/scripts/build_sokol_demo.sh index 736f57e..e76888d 100644 --- a/scripts/build_sokol_demo.sh +++ b/scripts/build_sokol_demo.sh @@ -84,7 +84,7 @@ popd > /dev/null path_stb_truetype="$path_thirdparty/stb/src" pushd "$path_stb_truetype" > /dev/null - eval make -C "$path_stb_truetype" + make popd > /dev/null source "$(dirname "$0")/helpers/odin_compiler_defs.sh" diff --git a/thirdparty/stb/lib/stb_truetype.a b/thirdparty/stb/lib/stb_truetype.a new file mode 100644 index 0000000..4c94036 Binary files /dev/null and b/thirdparty/stb/lib/stb_truetype.a differ diff --git a/thirdparty/stb/src/Makefile b/thirdparty/stb/src/Makefile index 27361c1..597616a 100644 --- a/thirdparty/stb/src/Makefile +++ b/thirdparty/stb/src/Makefile @@ -6,6 +6,8 @@ else all: unix endif +$(info Current OS is: $(OS)) + wasm: mkdir -p ../lib $(CC) -c -Os --target=wasm32 --sysroot=$(shell odin root)/vendor/libc stb_truetype.c -o ../lib/stb_truetype_wasm.o @@ -13,15 +15,13 @@ wasm: unix: mkdir -p ../lib $(CC) -c -O2 -Os -fPIC stb_truetype.c - $(AR) rcs ../lib/stb_truetype.a stb_truetype.o - - #$(CC) -fPIC -shared -Wl,-soname=stb_truetype.so -o ../lib/stb_truetype.so stb_image_truetype.o + $(AR) rcs ../lib/stb_truetype.a stb_truetype.o + #$(CC) -fPIC -shared -Wl,-soname=stb_truetype.so -o ../lib/stb_truetype.so stb_image_truetype.o rm *.o darwin: mkdir -p ../lib - lipo -create stb_truetype-x86_64.o stb_truetype-arm64.o -output ../lib/darwin/stb_truetype.a $(CC) -arch x86_64 -c -O2 -Os -fPIC stb_truetype.c -o stb_truetype-x86_64.o -mmacosx-version-min=10.12 $(CC) -arch arm64 -c -O2 -Os -fPIC stb_truetype.c -o stb_truetype-arm64.o -mmacosx-version-min=10.12 - + lipo -create stb_truetype-x86_64.o stb_truetype-arm64.o -output ../lib/darwin/stb_truetype.a rm *.o diff --git a/thirdparty/stb/src/gb/gb.h b/thirdparty/stb/src/gb/gb.h index adeb554..20118b0 100644 --- a/thirdparty/stb/src/gb/gb.h +++ b/thirdparty/stb/src/gb/gb.h @@ -537,6 +537,8 @@ typedef i32 b32; // NOTE(bill): Prefer this!!! #else #define gb_inline __forceinline #endif + #elif (__GNUC__) + #define gb_inline inline #else #define gb_inline __attribute__ ((__always_inline__)) #endif @@ -964,11 +966,12 @@ gb_mutex_init(&m); #endif +typedef struct gbThread gbThread; -#define GB_THREAD_PROC(name) isize name(struct gbThread *thread) +#define GB_THREAD_PROC(name) isize name(gbThread *thread) typedef GB_THREAD_PROC(gbThreadProc); -typedef struct gbThread { +struct gbThread { #if defined(GB_SYSTEM_WINDOWS) void * win32_handle; #else @@ -983,7 +986,7 @@ typedef struct gbThread { gbSemaphore semaphore; isize stack_size; b32 volatile is_running; -} gbThread; +}; GB_DEF void gb_thread_init (gbThread *t); GB_DEF void gb_thread_destroy (gbThread *t);