summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathieu Malaterre <mathieu.malaterre@gmail.com>2012-09-10 12:38:22 +0000
committerMathieu Malaterre <mathieu.malaterre@gmail.com>2012-09-10 12:38:22 +0000
commit0452ebdfcd6170c595ef791992bbeee2a6473352 (patch)
treeb0a269cce139c0eaf703f55b10df798c826044db
parentc8b8c4cf3059b903cd613e4a8242ba09ce5a7869 (diff)
[trunk] Use new gcc feature to actually hide exported symbols
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
-rw-r--r--libopenjpeg/openjpeg.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/libopenjpeg/openjpeg.h b/libopenjpeg/openjpeg.h
index 6e56f51a..de1576ff 100644
--- a/libopenjpeg/openjpeg.h
+++ b/libopenjpeg/openjpeg.h
@@ -53,7 +53,14 @@
#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