]> granicus.if.org Git - openjpeg/commitdiff
[trunk] Use new gcc feature to actually hide exported symbols
authorMathieu Malaterre <mathieu.malaterre@gmail.com>
Mon, 10 Sep 2012 12:38:22 +0000 (12:38 +0000)
committerMathieu Malaterre <mathieu.malaterre@gmail.com>
Mon, 10 Sep 2012 12:38:22 +0000 (12:38 +0000)
Right now we are only using the Windows/POSIX compatibility layer. This means that we have only been marking explicitely which symbols to export.
What this also means is that for one to explicitely remove non-explicitely marked symbols, one has to set -fvisibility=hidden as CFLAGS

libopenjpeg/openjpeg.h

index 6e56f51acdda8254cd00b7161569bf10932e7a9c..de1576ff6755420c797e998e147f6f68dd185777 100644 (file)
 #endif
 
 #if defined(OPJ_STATIC) || !defined(_WIN32)
+/* http://gcc.gnu.org/wiki/Visibility */
+#if __GNUC__ >= 4
+#define OPJ_API    __attribute__ ((visibility ("default")))
+#define OPJ_LOCAL  __attribute__ ((visibility ("hidden")))
+#else
 #define OPJ_API
+#define OPJ_LOCAL
+#endif
 #define OPJ_CALLCONV
 #else
 #define OPJ_CALLCONV __stdcall