mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Allow external definition of MRB_API macro
When building WebAssembly targets with clang (e.g. wasm32-unknown-unknown), all
symbols are hidden by default. To export a symbol, it must be marked with
__attribute__((visibility(default)))
Rather than detecting this exotic target in mruby, allow MRB_API to be defined
externally.
This commit is contained in:
@@ -62,6 +62,7 @@ MRB_BEGIN_DECL
|
||||
#define MRB_INLINE static inline
|
||||
|
||||
/** Declare a public MRuby API function. */
|
||||
#ifndef MRB_API
|
||||
#if defined(MRB_BUILD_AS_DLL)
|
||||
#if defined(MRB_CORE) || defined(MRB_LIB)
|
||||
# define MRB_API __declspec(dllexport)
|
||||
@@ -71,6 +72,7 @@ MRB_BEGIN_DECL
|
||||
#else
|
||||
# define MRB_API extern
|
||||
#endif
|
||||
#endif
|
||||
|
||||
MRB_END_DECL
|
||||
|
||||
|
||||
Reference in New Issue
Block a user