Mesa (master): mapi: Use MAPI_EXPORT to export public functions.

Chia-I Wu olv at kemper.freedesktop.org
Sat Aug 21 07:01:30 UTC 2010


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

Author: Chia-I Wu <olv at lunarg.com>
Date:   Sat Aug 21 13:03:50 2010 +0800

mapi: Use MAPI_EXPORT to export public functions.

mapi.h is included by vgapi and st/vega.  On win32, the macro expands to
dllexport and dllimport respectively.

---

 src/mapi/mapi/mapi.h      |   22 ++++++++++++++++------
 src/mapi/vgapi/SConscript |    1 +
 2 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/src/mapi/mapi/mapi.h b/src/mapi/mapi/mapi.h
index 8832b3d..c7e43e2 100644
--- a/src/mapi/mapi/mapi.h
+++ b/src/mapi/mapi/mapi.h
@@ -31,26 +31,36 @@
 
 #include "u_compiler.h"
 
+#ifdef _WIN32
+#ifdef MAPI_DLL_EXPORTS
+#define MAPI_EXPORT __declspec(dllexport)
+#else
+#define MAPI_EXPORT __declspec(dllimport)
+#endif
+#else /* _WIN32 */
+#define MAPI_EXPORT PUBLIC
+#endif
+
 typedef void (*mapi_proc)(void);
 
 struct mapi_table;
 
-PUBLIC void
+MAPI_EXPORT void
 mapi_init(const char *spec);
 
-PUBLIC mapi_proc
+MAPI_EXPORT mapi_proc
 mapi_get_proc_address(const char *name);
 
-PUBLIC struct mapi_table *
+MAPI_EXPORT struct mapi_table *
 mapi_table_create(void);
 
-PUBLIC void
+MAPI_EXPORT void
 mapi_table_destroy(struct mapi_table *tbl);
 
-PUBLIC void
+MAPI_EXPORT void
 mapi_table_fill(struct mapi_table *tbl, const mapi_proc *procs);
 
-PUBLIC void
+MAPI_EXPORT void
 mapi_table_make_current(const struct mapi_table *tbl);
 
 #endif /* _MAPI_H_ */
diff --git a/src/mapi/vgapi/SConscript b/src/mapi/vgapi/SConscript
index bf51264..20d7f27 100644
--- a/src/mapi/vgapi/SConscript
+++ b/src/mapi/vgapi/SConscript
@@ -18,6 +18,7 @@ if env['platform'] != 'winddk':
 
 	env.Append(CPPDEFINES = [
 		'MAPI_ABI_HEADER=\\"vgapi/vgapi_tmp.h\\"',
+		'MAPI_DLL_EXPORTS',
 		'KHRONOS_DLL_EXPORTS',
 	])
 




More information about the mesa-commit mailing list