X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb-python/blobdiff_plain/202d82b7a790102c5da9dbb54d36e731e326f3f0..740847afe208bb8f33e7d6cf642acaf4aa739f6a:/catacomb-python.h diff --git a/catacomb-python.h b/catacomb-python.h index 6c1ae21..bf3d426 100644 --- a/catacomb-python.h +++ b/catacomb-python.h @@ -120,6 +120,21 @@ #include #include +/*----- Other preliminaries -----------------------------------------------*/ + +#define GOBBLE_SEMI extern int notexist +#if defined(__GNUC__) && defined(__ELF__) +# define PRIVATE_SYMBOLS _Pragma("GCC visibility push(hidden)") GOBBLE_SEMI +# define PUBLIC_SYMBOLS _Pragma("GCC visibility pop") GOBBLE_SEMI +# define EXPORT __attribute__((__visibility__("default"))) +#else +# define PRIVATE_SYMBOLS GOBBLE_SEMI +# define PUBLIC_SYMBOLS GOBBLE_SEMI +# define EXPORT +#endif + +PRIVATE_SYMBOLS; + /*----- Utility macros ----------------------------------------------------*/ #define RETURN_OBJ(obj) do { Py_INCREF(obj); return (obj); } while (0)