[trunk] Fix compilation:
[openjpeg.git] / src / lib / openmj2 / openjpeg.h
index d77df6ca1c1c76ca20616baa9424c79c148484a9..defed5a3f878572ca8088a4dc6f088015fd2f8e5 100644 (file)
@@ -33,7 +33,6 @@
 #ifndef OPENJPEG_H
 #define OPENJPEG_H
 
-
 /* 
 ==========================================================
    Compiler directives
 */
 
 #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