diff --git a/src/julia.h b/src/julia.h index a4b61a4ebd913..02ccec09069b1 100644 --- a/src/julia.h +++ b/src/julia.h @@ -749,6 +749,9 @@ enum jlsmall_typeof_tags { jl_bitstags_first = jl_char_tag, // n.b. bool is not considered a bitstype, since it can be compared by pointer jl_max_tags = 64 }; +#ifndef JL_LIBRARY_EXPORTS +JL_DLLIMPORT +#endif extern jl_datatype_t *small_typeof[(jl_max_tags << 4) / sizeof(jl_datatype_t*)]; static inline jl_value_t *jl_to_typeof(uintptr_t t) { diff --git a/test/embedding/embedding.c b/test/embedding/embedding.c index 1294d4cdafb45..c5b8845b7c823 100644 --- a/test/embedding/embedding.c +++ b/test/embedding/embedding.c @@ -192,6 +192,12 @@ int main() checked_eval_string("f28825()"); } + { + // jl_typeof works (#50714) + jl_value_t *v = checked_eval_string("sqrt(2.0)"); + jl_value_t *t = jl_typeof(v); + } + JL_TRY { jl_error("exception thrown"); }