@@ -8,17 +8,22 @@ from .gdextension_interface cimport *
88
99
1010cdef extern from * nogil:
11- # Global variables defined in `pythonscript_gdextension_ptrs.c`
12- # Given `libpythonscript.so` is responsible for initializing the Python
13- # interpreter, we are guanteed `pythonscript_gdapi` symbol is always
14- # resolved and set to a non-null value \o/
1511 """
1612 #include <godot /gdextension_interface.h >
1713 #ifdef _WIN32
1814 # define DLL_IMPORT __declspec(dllimport)
1915 #else
20- # define DLL_IMPORT
16+ # define DLL_IMPORT __attribute__((visibility("default")))
2117 #endif
18+ """
19+
20+
21+ cdef extern from * nogil:
22+ # Global variables defined in `pythonscript_gdextension_ptrs.c`
23+ # Given `libpythonscript.so` is responsible for initializing the Python
24+ # interpreter, we are guanteed `pythonscript_gdapi` symbol is always
25+ # resolved and set to a non-null value \o/
26+ """
2227 DLL_IMPORT extern GDExtensionInterfaceGetProcAddress pythonscript_gdptr_get_proc_address;
2328 DLL_IMPORT extern GDExtensionClassLibraryPtr pythonscript_gdptr_library;
2429 """
@@ -28,12 +33,6 @@ cdef extern from * nogil:
2833
2934cdef extern from * nogil:
3035 """
31- #include <godot /gdextension_interface.h >
32- #ifdef _WIN32
33- # define DLL_IMPORT __declspec(dllimport)
34- #else
35- # define DLL_IMPORT
36- #endif
3736 DLL_IMPORT extern void (*pythonscript_gdptr_get_godot_version)(GDExtensionGodotVersion *r_godot_version);
3837 DLL_IMPORT extern void *(*pythonscript_gdptr_mem_alloc)(size_t p_bytes);
3938 DLL_IMPORT extern void *(*pythonscript_gdptr_mem_realloc)(void *p_ptr, size_t p_bytes);
@@ -343,12 +342,6 @@ cdef extern from * nogil:
343342# Godot variant from/into Python object conversions
344343cdef extern from * nogil:
345344 """
346- #include <godot /gdextension_interface.h >
347- #ifdef _WIN32
348- # define DLL_IMPORT __declspec(dllimport)
349- #else
350- # define DLL_IMPORT
351- #endif
352345 DLL_IMPORT extern GDExtensionTypeFromVariantConstructorFunc pythonscript_gdptr_object_from_variant;
353346 DLL_IMPORT extern GDExtensionVariantFromTypeConstructorFunc pythonscript_gdptr_object_into_variant;
354347 DLL_IMPORT extern GDExtensionTypeFromVariantConstructorFunc pythonscript_gdptr_bool_from_variant;
@@ -373,12 +366,6 @@ cdef extern from * nogil:
373366# {{ builtin.original_name }}
374367cdef extern from * nogil:
375368 """
376- #include <godot /gdextension_interface.h >
377- #ifdef _WIN32
378- # define DLL_IMPORT __declspec(dllimport)
379- #else
380- # define DLL_IMPORT
381- #endif
382369{% for c in builtin .constructors %}
383370 DLL_IMPORT extern GDExtensionPtrConstructor pythonscript_gdptr_{{ builtin.snake_name }}_constructor_{{ c.index }};
384371{% endfor %}
@@ -443,12 +430,6 @@ cdef extern from * nogil:
443430# Utility functions
444431cdef extern from * nogil:
445432 """
446- #include <godot /gdextension_interface.h >
447- #ifdef _WIN32
448- # define DLL_IMPORT __declspec(dllimport)
449- #else
450- # define DLL_IMPORT
451- #endif
452433{% for utility in api .utility_functions %}
453434 DLL_IMPORT extern GDExtensionPtrUtilityFunction pythonscript_gdptr_utility_{{ utility.original_name }};
454435{% endfor %}
0 commit comments