Skip to content

Commit

Permalink
Try to find the correct extern inline definition for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Keno committed Aug 4, 2024
1 parent 22aaeb6 commit 27286c2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/julia_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ STATIC_INLINE int jl_bpart_is_some_guard(jl_binding_partition_t *b) JL_NOTSAFEPO
return b->kind == BINDING_KIND_FAILED || b->kind == BINDING_KIND_GUARD || b->kind == BINDING_KIND_DECLARED;
}

JL_DLLEXPORT inline jl_binding_partition_t *jl_get_binding_partition(jl_binding_t *b, size_t world) JL_NOTSAFEPOINT {
EXTERN_INLINE_DECLARE jl_binding_partition_t *jl_get_binding_partition(jl_binding_t *b, size_t world) JL_NOTSAFEPOINT {
if (b && jl_is_globalref(b))
b = ((jl_globalref_t*)b)->binding;
if (!b)
Expand Down
2 changes: 1 addition & 1 deletion src/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ extern "C" {
#endif

// In this translation unit and this translation unit only emit this symbol `extern` for use by julia
extern JL_DLLEXPORT jl_binding_partition_t *jl_get_binding_partition(jl_binding_t *b, size_t world) JL_NOTSAFEPOINT;
EXTERN_INLINE_DEFINE jl_binding_partition_t *jl_get_binding_partition(jl_binding_t *b, size_t world) JL_NOTSAFEPOINT;

JL_DLLEXPORT jl_module_t *jl_new_module_(jl_sym_t *name, jl_module_t *parent, uint8_t default_names)
{
Expand Down
7 changes: 7 additions & 0 deletions src/support/dtypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,13 @@ typedef intptr_t ssize_t;
#define STATIC_INLINE static inline
#define FORCE_INLINE static inline __attribute__((always_inline))

#ifdef _OS_WINDOWS_
#define EXTERN_INLINE_DECLARE inline
#else
#define EXTERN_INLINE_DECLARE inline __attribute__ ((visibility("default")))
#endif
#define EXTERN_INLINE_DEFINE extern inline JL_DLLEXPORT

#if defined(_OS_WINDOWS_) && !defined(_COMPILER_GCC_)
# define NOINLINE __declspec(noinline)
# define NOINLINE_DECL(f) __declspec(noinline) f
Expand Down

0 comments on commit 27286c2

Please sign in to comment.