Skip to content

Commit

Permalink
feat: allow export load at runtime (#263)
Browse files Browse the repository at this point in the history
  • Loading branch information
zaucy authored Sep 18, 2024
1 parent 4064596 commit e811be1
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 6 deletions.
8 changes: 7 additions & 1 deletion ecsact/runtime/async.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@
# if defined(ECSACT_ASYNC_API)
# define ECSACT_ASYNC_API_FN(ret, name) ECSACT_ASYNC_API ret name
# elif defined(ECSACT_ASYNC_API_LOAD_AT_RUNTIME)
# define ECSACT_ASYNC_API_FN(ret, name) ECSACT_EXTERN ret(*name)
# if defined(ECSACT_ASYNC_API_EXPORT)
# define ECSACT_ASYNC_API_FN(ret, name) \
ECSACT_EXTERN ECSACT_EXPORT(#name) ret(*name)
# else
# define ECSACT_ASYNC_API_FN(ret, name) \
ECSACT_EXTERN ECSACT_IMPORT("env", #name) ret(*name)
# endif
# elif defined(ECSACT_ASYNC_API_EXPORT)
# define ECSACT_ASYNC_API_FN(ret, name) \
ECSACT_EXTERN ECSACT_EXPORT(#name) ret name
Expand Down
8 changes: 7 additions & 1 deletion ecsact/runtime/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@
# if defined(ECSACT_CORE_API)
# define ECSACT_CORE_API_FN(ret, name) ECSACT_CORE_API ret name
# elif defined(ECSACT_CORE_API_LOAD_AT_RUNTIME)
# define ECSACT_CORE_API_FN(ret, name) ECSACT_EXTERN ret(*name)
# if defined(ECSACT_CORE_API_EXPORT)
# define ECSACT_CORE_API_FN(ret, name) \
ECSACT_EXTERN ECSACT_EXPORT(#name) ret(*name)
# else
# define ECSACT_CORE_API_FN(ret, name) \
ECSACT_EXTERN ECSACT_IMPORT("env", #name) ret(*name)
# endif
# elif defined(ECSACT_CORE_API_EXPORT)
# define ECSACT_CORE_API_FN(ret, name) \
ECSACT_EXTERN ECSACT_EXPORT(#name) ret name
Expand Down
8 changes: 7 additions & 1 deletion ecsact/runtime/dynamic.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@
# if defined(ECSACT_DYNAMIC_API)
# define ECSACT_DYNAMIC_API_FN(ret, name) ECSACT_DYNAMIC_API ret name
# elif defined(ECSACT_DYNAMIC_API_LOAD_AT_RUNTIME)
# define ECSACT_DYNAMIC_API_FN(ret, name) ECSACT_EXTERN ret(*name)
# if defined(ECSACT_DYNAMIC_API_EXPORT)
# define ECSACT_DYNAMIC_API_FN(ret, name) \
ECSACT_EXTERN ECSACT_EXPORT(#name) ret(*name)
# else
# define ECSACT_DYNAMIC_API_FN(ret, name) \
ECSACT_EXTERN ECSACT_IMPORT("env", #name) ret(*name)
# endif
# elif defined(ECSACT_DYNAMIC_API_EXPORT)
# define ECSACT_DYNAMIC_API_FN(ret, name) \
ECSACT_EXTERN ECSACT_EXPORT(#name) ret name
Expand Down
8 changes: 7 additions & 1 deletion ecsact/runtime/meta.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@
# if defined(ECSACT_META_API)
# define ECSACT_META_API_FN(ret, name) ECSACT_META_API ret name
# elif defined(ECSACT_META_API_LOAD_AT_RUNTIME)
# define ECSACT_META_API_FN(ret, name) ECSACT_EXTERN ret(*name)
# if defined(ECSACT_META_API_EXPORT)
# define ECSACT_META_API_FN(ret, name) \
ECSACT_EXTERN ECSACT_EXPORT(#name) ret(*name)
# else
# define ECSACT_META_API_FN(ret, name) \
ECSACT_EXTERN ECSACT_IMPORT("env", #name) ret(*name)
# endif
# elif defined(ECSACT_META_API_EXPORT)
# define ECSACT_META_API_FN(ret, name) \
ECSACT_EXTERN ECSACT_EXPORT(#name) ret name
Expand Down
8 changes: 7 additions & 1 deletion ecsact/runtime/serialize.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@
# if defined(ECSACT_SERIALIZE_API)
# define ECSACT_SERIALIZE_API_FN(ret, name) ECSACT_SERIALIZE_API ret name
# elif defined(ECSACT_SERIALIZE_API_LOAD_AT_RUNTIME)
# define ECSACT_SERIALIZE_API_FN(ret, name) ECSACT_EXTERN ret(*name)
# if defined(ECSACT_SERIALIZE_API_EXPORT)
# define ECSACT_SERIALIZE_API_FN(ret, name) \
ECSACT_EXTERN ECSACT_EXPORT(#name) ret(*name)
# else
# define ECSACT_SERIALIZE_API_FN(ret, name) \
ECSACT_EXTERN ECSACT_IMPORT("env", #name) ret(*name)
# endif
# elif defined(ECSACT_SERIALIZE_API_EXPORT)
# define ECSACT_SERIALIZE_API_FN(ret, name) \
ECSACT_EXTERN ECSACT_EXPORT(#name) ret name
Expand Down
8 changes: 7 additions & 1 deletion ecsact/runtime/static.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@
# if defined(ECSACT_STATIC_API)
# define ECSACT_STATIC_API_FN(ret, name) ECSACT_STATIC_API ret name
# elif defined(ECSACT_STATIC_API_LOAD_AT_RUNTIME)
# define ECSACT_STATIC_API_FN(ret, name) ECSACT_EXTERN ret(*name)
# if defined(ECSACT_STATIC_API_EXPORT)
# define ECSACT_STATIC_API_FN(ret, name) \
ECSACT_EXTERN ECSACT_EXPORT(#name) ret(*name)
# else
# define ECSACT_STATIC_API_FN(ret, name) \
ECSACT_EXTERN ECSACT_IMPORT("env", #name) ret(*name)
# endif
# elif defined(ECSACT_STATIC_API_EXPORT)
# define ECSACT_STATIC_API_FN(ret, name) \
ECSACT_EXTERN ECSACT_EXPORT(#name) ret name
Expand Down

0 comments on commit e811be1

Please sign in to comment.