summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2014-04-10 13:30:05 -0700
committerEric Anholt <eric@anholt.net>2014-04-10 13:37:47 -0700
commit568533441ffe113ac919ce3db16fcde8126a9b70 (patch)
tree307c6cbdf0aad38eabd8189262521d93fda40210
parent6eb075c70e2f91a9c45a90677bd46e8fb0432655 (diff)
downloadlibepoxy-568533441ffe113ac919ce3db16fcde8126a9b70.tar.gz
Move __stdcall into the parens for function pointer definitions.
MSVC 2010 appears to require that it be located there.
-rw-r--r--include/epoxy/gl.h11
-rw-r--r--src/dispatch_common.h19
-rwxr-xr-xsrc/gen_dispatch.py2
3 files changed, 18 insertions, 14 deletions
diff --git a/include/epoxy/gl.h b/include/epoxy/gl.h
index 76634e3..bbc06c0 100644
--- a/include/epoxy/gl.h
+++ b/include/epoxy/gl.h
@@ -51,7 +51,8 @@ extern "C" {
/* APIENTRY and GLAPIENTRY are not used on Linux or Mac. */
#define APIENTRY
#define GLAPIENTRY
-#define EPOXYAPIENTRY
+#define EPOXY_IMPORTEXPORT
+#define EPOXY_CALLSPEC
#define GLAPI
#define KHRONOS_APIENTRY
#define KHRONOS_APICALL
@@ -65,8 +66,12 @@ extern "C" {
#define GLAPIENTRY APIENTRY
#endif
-#ifndef EPOXYAPIENTRY
-#define EPOXYAPIENTRY __declspec(dllimport) __stdcall
+#ifndef EPOXY_CALLSPEC
+#define EPOXY_CALLSPEC __stdcall
+#endif
+
+#ifndef EPOXY_IMPORTEXPORT
+#define EPOXY_IMPORTEXPORT __declspec(dllimport)
#endif
#ifndef GLAPI
diff --git a/src/dispatch_common.h b/src/dispatch_common.h
index 5974aa0..28bf533 100644
--- a/src/dispatch_common.h
+++ b/src/dispatch_common.h
@@ -27,18 +27,17 @@
#define PLATFORM_HAS_EGL 0
#define PLATFORM_HAS_GLX 0
#define PLATFORM_HAS_WGL 1
-#define EPOXYCALL __stdcall
-#define EPOXYAPIENTRY __declspec(dllexport) EPOXYCALL
+#define EPOXY_IMPORTEXPORT __declspec(dllexport)
#elif defined(__APPLE__)
#define PLATFORM_HAS_EGL 0
#define PLATFORM_HAS_GLX 1
#define PLATFORM_HAS_WGL 0
-#define EPOXYCALL
+#define EPOXY_IMPORTEXPORT
#else
#define PLATFORM_HAS_EGL 1
#define PLATFORM_HAS_GLX 1
#define PLATFORM_HAS_WGL 0
-#define EPOXYCALL
+#define EPOXY_IMPORTEXPORT
#endif
#include "epoxy/gl.h"
@@ -77,7 +76,7 @@
#define WRAPPER(x) x ## _wrapped
#define GEN_GLOBAL_REWRITE_PTR(name, args, passthrough) \
- static EPOXYCALL void \
+ static EPOXY_CALLSPEC void \
name##_global_rewrite_ptr args \
{ \
name = (void *)name##_resolver(); \
@@ -85,7 +84,7 @@
}
#define GEN_GLOBAL_REWRITE_PTR_RET(ret, name, args, passthrough) \
- static EPOXYCALL ret \
+ static EPOXY_CALLSPEC ret \
name##_global_rewrite_ptr args \
{ \
name = (void *)name##_resolver(); \
@@ -94,7 +93,7 @@
#if USING_DISPATCH_TABLE
#define GEN_DISPATCH_TABLE_REWRITE_PTR(name, args, passthrough) \
- static EPOXYCALL void \
+ static EPOXY_CALLSPEC void \
name##_dispatch_table_rewrite_ptr args \
{ \
struct dispatch_table *dispatch_table = get_dispatch_table(); \
@@ -104,7 +103,7 @@
}
#define GEN_DISPATCH_TABLE_REWRITE_PTR_RET(ret, name, args, passthrough) \
- static EPOXYCALL ret \
+ static EPOXY_CALLSPEC ret \
name##_dispatch_table_rewrite_ptr args \
{ \
struct dispatch_table *dispatch_table = get_dispatch_table(); \
@@ -114,14 +113,14 @@
}
#define GEN_DISPATCH_TABLE_THUNK(name, args, passthrough) \
- static EPOXYCALL void \
+ static EPOXY_CALLSPEC void \
name##_dispatch_table_thunk args \
{ \
get_dispatch_table()->name passthrough; \
}
#define GEN_DISPATCH_TABLE_THUNK_RET(ret, name, args, passthrough) \
- static EPOXYCALL ret \
+ static EPOXY_CALLSPEC ret \
name##_dispatch_table_thunk args \
{ \
return get_dispatch_table()->name passthrough; \
diff --git a/src/gen_dispatch.py b/src/gen_dispatch.py
index 072a0fe..ab526ef 100755
--- a/src/gen_dispatch.py
+++ b/src/gen_dispatch.py
@@ -525,7 +525,7 @@ class Generator(object):
self.write_function_ptr_typedefs()
for func in self.sorted_functions:
- self.outln('extern EPOXYAPIENTRY {0} (*epoxy_{1})({2});'.format(func.ret_type,
+ self.outln('extern EPOXY_IMPORTEXPORT {0} (EPOXY_CALLSPEC *epoxy_{1})({2});'.format(func.ret_type,
func.name,
func.args_decl))
self.outln('')