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 10
10
JL_EXPORTED_DATA_POINTERS (XX )
11
11
#undef XX
12
12
13
- // Define symbol data as `$type) $(name);`
13
+ // Define symbol data as `$( type) $(name);`
14
14
#define XX (name , type ) JL_DLLEXPORT type name;
15
15
JL_EXPORTED_DATA_SYMBOLS (XX )
16
16
#undef XX
17
17
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;
20
26
JL_EXPORTED_FUNCS (XX )
21
27
#undef XX
22
28
@@ -29,7 +35,7 @@ static const char *const jl_exported_func_names[] = {
29
35
#undef XX
30
36
31
37
#define XX (name ) &name##_addr,
32
- static const void * * jl_exported_func_addrs [] = {
38
+ static anonfunc * * const jl_exported_func_addrs [] = {
33
39
JL_EXPORTED_FUNCS (XX )
34
40
NULL
35
41
};
Original file line number Diff line number Diff line change @@ -161,7 +161,7 @@ __attribute__((constructor)) void jl_load_libjulia_internal(void) {
161
161
// Once we have libjulia-internal loaded, re-export its symbols:
162
162
for (unsigned int symbol_idx = 0 ; jl_exported_func_names [symbol_idx ] != NULL ; ++ symbol_idx ) {
163
163
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 ] ) {
165
165
jl_loader_print_stderr3 ("ERROR: Unable to load " , jl_exported_func_names [symbol_idx ], " from libjulia-internal" );
166
166
exit (1 );
167
167
}
You can’t perform that action at this time.
0 commit comments