1
0
mirror of https://github.com/janet-lang/janet synced 2024-12-25 07:50:27 +00:00

Appease MSVC.

This commit is contained in:
Calvin Rose 2019-05-29 22:11:56 -04:00
parent 1b63215aad
commit c8cf7c2445
2 changed files with 5 additions and 3 deletions

View File

@ -57,6 +57,7 @@ typedef void *Clib;
JanetModule janet_native(const char *name, const uint8_t **error) {
Clib lib = load_clib(name);
JanetModule init;
JanetModconf getter;
if (!lib) {
*error = janet_cstring(error_clib());
return NULL;
@ -66,12 +67,12 @@ JanetModule janet_native(const char *name, const uint8_t **error) {
*error = janet_cstring("could not find the _janet_init symbol");
return NULL;
}
JanetBuildConfig(*modconf_getter)(void) = symbol_clib(lib, "_janet_mod_config");
if (!modconf_getter) {
getter = (JanetModconf) symbol_clib(lib, "_janet_mod_config");
if (!getter) {
*error = janet_cstring("could not find the _janet_mod_config symbol");
return NULL;
}
JanetBuildConfig modconf = modconf_getter();
JanetBuildConfig modconf = getter();
JanetBuildConfig host = janet_config_current();
if (host.major != modconf.major ||
host.minor < modconf.minor ||

View File

@ -1216,6 +1216,7 @@ JANET_API void *janet_abstract(const JanetAbstractType *type, size_t size);
/* Native */
typedef void (*JanetModule)(JanetTable *);
typedef JanetBuildConfig(*JanetModconf)(void);
JANET_API JanetModule janet_native(const char *name, const uint8_t **error);
/* Marshaling */