explicitly mark exported functions in wasm module with ORCA_EXPORT

This commit is contained in:
Martin Fouilleul 2023-06-25 19:57:28 +02:00
parent 1f75f40536
commit 7d4fdf9a75
3 changed files with 14 additions and 7 deletions

View File

@ -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__ \

View File

@ -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;

View File

@ -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_