Skip to content

Commit b9b0c35

Browse files
imciner2staticfloat
authored andcommitted
Allow libjulia to contain non-pointer variables
Before it was always creating the variables as a pointer even if they are being referenced as a differnt type in the internal library. (cherry picked from commit 8ace36f)
1 parent 367cf88 commit b9b0c35

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

cli/jl_exports.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,14 @@
55
#include "../src/jl_exported_data.inc"
66
#include "../src/jl_exported_funcs.inc"
77

8-
// Define data symbols as `const void * $(name);`
8+
// Define pointer data as `const void * $(name);`
99
#define XX(name) JL_DLLEXPORT const void * name;
10-
JL_EXPORTED_DATA(XX)
10+
JL_EXPORTED_DATA_POINTERS(XX)
11+
#undef XX
12+
13+
// Define symbol data as `$type) $(name);`
14+
#define XX(name, type) JL_DLLEXPORT type name;
15+
JL_EXPORTED_DATA_SYMBOLS(XX)
1116
#undef XX
1217

1318
// Define holder locations for function addresses as `const void * $(name)_addr`

src/jl_exported_data.inc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#define JL_EXPORTED_DATA(XX) \
1+
// Pointers that are exposed through the public libjulia
2+
#define JL_EXPORTED_DATA_POINTERS(XX) \
23
XX(jl_abstractarray_type) \
34
XX(jl_abstractslot_type) \
45
XX(jl_abstractstring_type) \
@@ -62,7 +63,6 @@
6263
XX(jl_methoderror_type) \
6364
XX(jl_methtable_type) \
6465
XX(jl_module_type) \
65-
XX(jl_n_threads) \
6666
XX(jl_namedtuple_type) \
6767
XX(jl_namedtuple_typename) \
6868
XX(jl_newvarnode_type) \
@@ -117,3 +117,8 @@
117117
XX(jl_void_type) \
118118
XX(jl_voidpointer_type) \
119119
XX(jl_weakref_type)
120+
121+
122+
// Data symbols that are defined inside the public libjulia
123+
#define JL_EXPORTED_DATA_SYMBOLS(XX) \
124+
XX(jl_n_threads, int)

0 commit comments

Comments
 (0)