File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 1010JL_EXPORTED_DATA_POINTERS (XX )
1111#undef XX
1212
13- // Define symbol data as `$type) $(name);`
13+ // Define symbol data as `$( type) $(name);`
1414#define XX (name , type ) JL_DLLEXPORT type name;
1515JL_EXPORTED_DATA_SYMBOLS (XX )
1616#undef XX
1717
18- // Define holder locations for function addresses as `const void * $(name)_addr`
19- #define XX (name ) JL_HIDDEN const void * name##_addr;
18+ // Declare list of exported functions (sans type)
19+ #define XX (name ) JL_DLLEXPORT void name(void);
20+ typedef void (anonfunc )(void );
21+ JL_EXPORTED_FUNCS (XX )
22+ #undef XX
23+
24+ // Define holder locations for function addresses as `const void * $(name)_addr = & $(name);`
25+ #define XX (name ) JL_HIDDEN anonfunc * name##_addr = (anonfunc*)&name;
2026JL_EXPORTED_FUNCS (XX )
2127#undef XX
2228
@@ -29,7 +35,7 @@ static const char *const jl_exported_func_names[] = {
2935#undef XX
3036
3137#define XX (name ) &name##_addr,
32- static const void * * jl_exported_func_addrs [] = {
38+ static anonfunc * * const jl_exported_func_addrs [] = {
3339 JL_EXPORTED_FUNCS (XX )
3440 NULL
3541};
Original file line number Diff line number Diff line change @@ -161,7 +161,7 @@ __attribute__((constructor)) void jl_load_libjulia_internal(void) {
161161 // Once we have libjulia-internal loaded, re-export its symbols:
162162 for (unsigned int symbol_idx = 0 ; jl_exported_func_names [symbol_idx ] != NULL ; ++ symbol_idx ) {
163163 void * addr = lookup_symbol (libjulia_internal , jl_exported_func_names [symbol_idx ]);
164- if (addr == NULL ) {
164+ if (addr == NULL || addr == * jl_exported_func_addrs [ symbol_idx ] ) {
165165 jl_loader_print_stderr3 ("ERROR: Unable to load " , jl_exported_func_names [symbol_idx ], " from libjulia-internal" );
166166 exit (1 );
167167 }
You can’t perform that action at this time.
0 commit comments