X-Git-Url: http://git.efficios.com/?p=argpar.git;a=blobdiff_plain;f=argpar%2Fargpar.c;fp=argpar%2Fargpar.c;h=fab0556ccd2188d38da6990d4ed213a020f8d2d4;hp=4402d2537295472bfe1daf11bf5289f3270a462e;hb=a7e0140aef02f10fde13ee1fa3aa7d9672ff6ae2;hpb=393852d8338ba31df0d3d23510611ede16789618 diff --git a/argpar/argpar.c b/argpar/argpar.c index 4402d25..fab0556 100644 --- a/argpar/argpar.c +++ b/argpar/argpar.c @@ -12,6 +12,19 @@ #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 + * . + */ +#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)))