argpar.{c,h}: remove `ARGPAR_HIDDEN` from header file
[argpar.git] / argpar / argpar.c
index 4402d2537295472bfe1daf11bf5289f3270a462e..fab0556ccd2188d38da6990d4ed213a020f8d2d4 100644 (file)
 
 #include "argpar.h"
 
+/*
+ * If argpar is used in some shared library, we don't want said library
+ * to export its symbols, so mark them as "hidden".
+ *
+ * On Windows, symbols are local unless explicitly exported; see
+ * <https://gcc.gnu.org/wiki/Visibility>.
+ */
+#if defined(_WIN32) || defined(__CYGWIN__)
+# define ARGPAR_HIDDEN
+#else
+# define ARGPAR_HIDDEN __attribute__((visibility("hidden")))
+#endif
+
 #define ARGPAR_REALLOC(_ptr, _type, _nmemb)                            \
        ((_type *) realloc(_ptr, (_nmemb) * sizeof(_type)))
 
This page took 0.021668 seconds and 4 git commands to generate.