diff --git a/samples/pong/build.sh b/samples/pong/build.sh index 028d57a..a1d1233 100755 --- a/samples/pong/build.sh +++ b/samples/pong/build.sh @@ -4,7 +4,7 @@ wasmFlags="--target=wasm32 \ --no-standard-libraries \ -fno-builtin \ -Wl,--no-entry \ - -Wl,--export-all \ + -Wl,--export-dynamic \ -Wl,--allow-undefined \ -g \ -D__ORCA__ \ diff --git a/samples/pong/src/main.c b/samples/pong/src/main.c index ac9f4c7..9d35a82 100644 --- a/samples/pong/src/main.c +++ b/samples/pong/src/main.c @@ -36,7 +36,7 @@ mg_image image; mg_surface mg_surface_main(void); -void OnInit(void) +ORCA_EXPORT void OnInit(void) { //TODO create surface for main window surface = mg_surface_main(); @@ -70,19 +70,19 @@ void OnInit(void) mem_arena_clear(mem_scratch()); } -void OnFrameResize(u32 width, u32 height) +ORCA_EXPORT void OnFrameResize(u32 width, u32 height) { log_info("frame resize %u, %u", width, height); frameSize.x = width; frameSize.y = height; } -void OnMouseDown(int button) +ORCA_EXPORT void OnMouseDown(int button) { log_info("mouse down!"); } -void OnKeyDown(int key) +ORCA_EXPORT void OnKeyDown(int key) { if(key == KEY_SPACE) { @@ -106,7 +106,7 @@ void OnKeyDown(int key) } } -void OnKeyUp(int key) +ORCA_EXPORT void OnKeyUp(int key) { if(key == KEY_ENTER || key == KEY_SPACE) { @@ -124,7 +124,7 @@ void OnKeyUp(int key) } } -void OnFrameRefresh(void) +ORCA_EXPORT void OnFrameRefresh(void) { f32 aspect = frameSize.x/frameSize.y; diff --git a/sdk/orca.h b/sdk/orca.h index 0aacce1..9f7e8e5 100644 --- a/sdk/orca.h +++ b/sdk/orca.h @@ -13,8 +13,15 @@ #include"util/memory.h" #include"util/strings.h" #include"util/utf8.h" +#include"platform/platform.h" #include"platform/platform_log.h" #include"platform/platform_assert.h" #include"platform/platform_io.h" +#if COMPILER_CLANG + #define ORCA_EXPORT __attribute__((visibility("default"))) +#else + #error "Orca apps can only be compiled with clang for now" +#endif + #endif //__ORCA_H_