Skip to content

Commit

Permalink
Allow libjulia to contain non-pointer variables
Browse files Browse the repository at this point in the history
Before it was always creating the variables as a pointer
even if they are being referenced as a differnt type in the
internal library.
  • Loading branch information
imciner2 committed Dec 20, 2020
1 parent f6b0edc commit 8ace36f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
9 changes: 7 additions & 2 deletions cli/jl_exports.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@
#include "../src/jl_exported_data.inc"
#include "../src/jl_exported_funcs.inc"

// Define data symbols as `const void * $(name);`
// Define pointer data as `const void * $(name);`
#define XX(name) JL_DLLEXPORT const void * name;
JL_EXPORTED_DATA(XX)
JL_EXPORTED_DATA_POINTERS(XX)
#undef XX

// Define symbol data as `$type) $(name);`
#define XX(name, type) JL_DLLEXPORT type name;
JL_EXPORTED_DATA_SYMBOLS(XX)
#undef XX

// Define holder locations for function addresses as `const void * $(name)_addr`
Expand Down
9 changes: 7 additions & 2 deletions src/jl_exported_data.inc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#define JL_EXPORTED_DATA(XX) \
// Pointers that are exposed through the public libjulia
#define JL_EXPORTED_DATA_POINTERS(XX) \
XX(jl_abstractarray_type) \
XX(jl_abstractslot_type) \
XX(jl_abstractstring_type) \
Expand Down Expand Up @@ -62,7 +63,6 @@
XX(jl_methoderror_type) \
XX(jl_methtable_type) \
XX(jl_module_type) \
XX(jl_n_threads) \
XX(jl_namedtuple_type) \
XX(jl_namedtuple_typename) \
XX(jl_newvarnode_type) \
Expand Down Expand Up @@ -116,3 +116,8 @@
XX(jl_void_type) \
XX(jl_voidpointer_type) \
XX(jl_weakref_type)


// Data symbols that are defined inside the public libjulia
#define JL_EXPORTED_DATA_SYMBOLS(XX) \
XX(jl_n_threads, int)

0 comments on commit 8ace36f

Please sign in to comment.