Update KHRONOS_APICALL for _WIN32 platform.
authorChia-I Wu <olv@lunarg.com>
Mon, 31 May 2010 03:03:48 +0000 (11:03 +0800)
committerChia-I Wu <olv@lunarg.com>
Mon, 31 May 2010 03:31:07 +0000 (11:31 +0800)
Use __declspec(dllexport) when KHRONOS_DLL_EXPORTS is defined.

include/KHR/khrplatform.h
include/VG/vgplatform.h

index a4b88ebc3dfb0840fa4249e86222eeb4b9176c6a..447953940e64ccfb6adab9d25ce5857e3ace1931 100644 (file)
  * This precedes the return type of the function in the function prototype.
  */
 #if defined(_WIN32) && !defined(__SCITECH_SNAP__)
-#   define KHRONOS_APICALL __declspec(dllimport)
+#   if defined(KHRONOS_DLL_EXPORTS)
+#      define KHRONOS_APICALL __declspec(dllexport)
+#   else
+#      define KHRONOS_APICALL __declspec(dllimport)
+#   endif
 #elif defined (__SYMBIAN32__)
 #   define KHRONOS_APICALL IMPORT_C
 #elif (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303) \
index 2c626a971e1727b3f0b3a6bf854932a288a24a40..71dee68b9d4c1cf4ab0885e85786daa5068cf12d 100644 (file)
 #ifndef _VGPLATFORM_H\r
 #define _VGPLATFORM_H\r
 \r
+#include <KHR/khrplatform.h>\r
+\r
 #ifdef __cplusplus\r
 extern "C" {\r
 #endif\r
 \r
-#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303\r
-#  define VG_API_CALL __attribute__((visibility("default")))\r
-#  define VGU_API_CALL __attribute__((visibility("default")))\r
-#endif\r
-\r
 #ifndef VG_API_CALL \r
 #if defined(OPENVG_STATIC_LIBRARY)\r
 #      define VG_API_CALL\r
 #else\r
-#      if defined(_WIN32) || defined(__VC32__)                         /* Win32 */\r
-#              if defined (OPENVG_DLL_EXPORTS)\r
-#                      define VG_API_CALL __declspec(dllexport)\r
-#              else\r
-#                      define VG_API_CALL __declspec(dllimport)\r
-#              endif\r
-#      else \r
-#              define VG_API_CALL extern\r
-#      endif /* defined(_WIN32) ||... */\r
+#      define VG_API_CALL KHRONOS_APICALL\r
 #endif /* defined OPENVG_STATIC_LIBRARY */\r
 #endif /* ifndef VG_API_CALL */\r
 \r
@@ -63,15 +52,7 @@ extern "C" {
 #if defined(OPENVG_STATIC_LIBRARY)\r
 #      define VGU_API_CALL\r
 #else\r
-#      if defined(_WIN32) || defined(__VC32__)                         /* Win32 */\r
-#              if defined (OPENVG_DLL_EXPORTS)\r
-#                      define VGU_API_CALL __declspec(dllexport)\r
-#              else\r
-#                      define VGU_API_CALL __declspec(dllimport)\r
-#              endif\r
-#      else \r
-#              define VGU_API_CALL extern\r
-#      endif /* defined(_WIN32) ||... */\r
+#      define VGU_API_CALL KHRONOS_APICALL\r
 #endif /* defined OPENVG_STATIC_LIBRARY */\r
 #endif /* ifndef VGU_API_CALL */\r
 \r