]> git.tdb.fi Git - ext/libjpeg.git/blobdiff - jmorecfg.h
Use C linkage for symbols
[ext/libjpeg.git] / jmorecfg.h
index 54a7d1c447e4ed862caf5a905b0275efcf3629ef..565f13ef3da024c359891f41da6fae924fc198ae 100644 (file)
@@ -180,14 +180,28 @@ typedef unsigned int JDIMENSION;
  * or code profilers that require it.
  */
 
+#if defined(_WIN32)
+#if defined(JPEG_BUILD)
+#define LIBJPEG_API __declspec(dllexport)
+#elif defined(LIBJPEG_IMPORT)
+#define LIBJPEG_API __declspec(dllimport)
+#else
+#define LIBJPEG_API
+#endif
+#elif defined(__GNUC__)
+#define LIBJPEG_API __attribute__((visibility("default")))
+#else
+#define LIBJPEG_API
+#endif
+
 /* a function called through method pointers: */
 #define METHODDEF(type)                static type
 /* a function used only in its module: */
 #define LOCAL(type)            static type
 /* a function referenced thru EXTERNs: */
-#define GLOBAL(type)           type
+#define GLOBAL(type)           LIBJPEG_API type
 /* a reference to a GLOBAL function: */
-#define EXTERN(type)           extern type
+#define EXTERN(type)           LIBJPEG_API extern type
 
 
 /* This macro is used to declare a "method", that is, a function pointer.