Mesa (master): Define PUBLIC to dllexport on MSVC.

Chia-I Wu olv at kemper.freedesktop.org
Mon May 31 05:28:54 UTC 2010


Module: Mesa
Branch: master
Commit: ba26631d0d936523c7a8f002cf469e569aa6d7a3
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ba26631d0d936523c7a8f002cf469e569aa6d7a3

Author: Chia-I Wu <olv at lunarg.com>
Date:   Mon May 31 11:15:06 2010 +0800

Define PUBLIC to dllexport on MSVC.

Define PUBLIC to __declspec(dllexport) when _MVC_VER is defined.

---

 src/egl/main/eglcompiler.h            |   12 ++++++++----
 src/gallium/include/pipe/p_compiler.h |    2 ++
 src/mapi/mapi/u_compiler.h            |    4 ++--
 3 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/src/egl/main/eglcompiler.h b/src/egl/main/eglcompiler.h
index 6ecee51..90c75e8 100644
--- a/src/egl/main/eglcompiler.h
+++ b/src/egl/main/eglcompiler.h
@@ -62,10 +62,14 @@
 /**
  * Function visibility
  */
-#if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
-#  define PUBLIC __attribute__((visibility("default")))
-#else
-#  define PUBLIC
+#ifndef PUBLIC
+#  if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
+#    define PUBLIC __attribute__((visibility("default")))
+#  elif defined(_MSC_VER)
+#    define PUBLIC __declspec(dllexport)
+#  else
+#    define PUBLIC
+#  endif
 #endif
 
 /**
diff --git a/src/gallium/include/pipe/p_compiler.h b/src/gallium/include/pipe/p_compiler.h
index 9b31555..a14486a 100644
--- a/src/gallium/include/pipe/p_compiler.h
+++ b/src/gallium/include/pipe/p_compiler.h
@@ -102,6 +102,8 @@ typedef unsigned char boolean;
 #ifndef PUBLIC
 #  if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
 #    define PUBLIC __attribute__((visibility("default")))
+#  elif defined(_MSC_VER)
+#    define PUBLIC __declspec(dllexport)
 #  else
 #    define PUBLIC
 #  endif
diff --git a/src/mapi/mapi/u_compiler.h b/src/mapi/mapi/u_compiler.h
index cc9e2cd..f1752d1 100644
--- a/src/mapi/mapi/u_compiler.h
+++ b/src/mapi/mapi/u_compiler.h
@@ -28,10 +28,10 @@
 #ifndef PUBLIC
 #  if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
 #    define PUBLIC __attribute__((visibility("default")))
-#    define HIDDEN __attribute__((visibility("hidden")))
+#  elif defined(_MSC_VER)
+#    define PUBLIC __declspec(dllexport)
 #  else
 #    define PUBLIC
-#    define HIDDEN
 #  endif
 #endif
 




More information about the mesa-commit mailing list