summaryrefslogtreecommitdiff
path: root/core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/openjpeg.h
diff options
context:
space:
mode:
authorJUN FANG <jun_fang@foxitsoftware.com>2015-02-27 10:00:00 -0800
committerJUN FANG <jun_fang@foxitsoftware.com>2015-02-27 10:10:15 -0800
commit7dba98630d1db1ead3382ecda41a52932783e272 (patch)
tree452f6505903c971742a0a17502399ce4fda09b80 /core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/openjpeg.h
parent4cb0fa7b28a65c1f0f9636ba8bcfc6880f668e4a (diff)
downloadpdfium-7dba98630d1db1ead3382ecda41a52932783e272.tar.xz
Merge to XFA: Upgrade openjpeg to revision 2997.
BUG=457493 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/960183004
Diffstat (limited to 'core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/openjpeg.h')
-rw-r--r--core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/openjpeg.h34
1 files changed, 30 insertions, 4 deletions
diff --git a/core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/openjpeg.h b/core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/openjpeg.h
index b1e1c294c8..4a8e75ce5a 100644
--- a/core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/openjpeg.h
+++ b/core/src/fxcodec/fx_libopenjpeg/libopenjpeg20/openjpeg.h
@@ -76,10 +76,36 @@ Most compilers implement their own version of this keyword ...
#define OPJ_DEPRECATED(func) func
#endif
-// PDFium doesn't need to export any of these methods.
-#define OPJ_API
-#define OPJ_LOCAL
-#define OPJ_CALLCONV
+#if defined(OPJ_STATIC) || !defined(_WIN32)
+/* http://gcc.gnu.org/wiki/Visibility */
+# if __GNUC__ >= 4
+# if defined(OPJ_STATIC) /* static library uses "hidden" */
+# define OPJ_API __attribute__ ((visibility ("hidden")))
+# else
+# define OPJ_API __attribute__ ((visibility ("default")))
+# endif
+# define OPJ_LOCAL __attribute__ ((visibility ("hidden")))
+# else
+# define OPJ_API
+# define OPJ_LOCAL
+# endif
+# define OPJ_CALLCONV
+#else
+# define OPJ_CALLCONV __stdcall
+/*
+The following ifdef block is the standard way of creating macros which make exporting
+from a DLL simpler. All files within this DLL are compiled with the OPJ_EXPORTS
+symbol defined on the command line. this symbol should not be defined on any project
+that uses this DLL. This way any other project whose source files include this file see
+OPJ_API functions as being imported from a DLL, wheras this DLL sees symbols
+defined with this macro as being exported.
+*/
+# if defined(OPJ_EXPORTS) || defined(DLL_EXPORT)
+# define OPJ_API __declspec(dllexport)
+# else
+# define OPJ_API __declspec(dllimport)
+# endif /* OPJ_EXPORTS */
+#endif /* !OPJ_STATIC || !_WIN32 */
typedef int OPJ_BOOL;
#define OPJ_TRUE 1