From 7d5e8e9d5604736601e28f4c8530759fc537fd12 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Fri, 5 Jun 2015 17:38:26 -0700 Subject: [PATCH] Put the callspec after the return type for MSVC. Visual Studio does not like __stdcall before the return type, which is what GLAPIENTRY and EPOXY_CALLSPEC expands to on Windows. --- src/dispatch_common.c | 4 ++-- src/dispatch_common.h | 14 +++++++------- src/dispatch_wgl.c | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/dispatch_common.c b/src/dispatch_common.c index 1baaf36..7dd0a49 100644 --- a/src/dispatch_common.c +++ b/src/dispatch_common.c @@ -674,7 +674,7 @@ epoxy_print_failure_reasons(const char *name, } } -WRAPPER_VISIBILITY void +WRAPPER_VISIBILITY (void) WRAPPER(epoxy_glBegin)(GLenum primtype) { #ifdef _WIN32 @@ -688,7 +688,7 @@ WRAPPER(epoxy_glBegin)(GLenum primtype) epoxy_glBegin_unwrapped(primtype); } -WRAPPER_VISIBILITY void +WRAPPER_VISIBILITY (void) WRAPPER(epoxy_glEnd)(void) { epoxy_glEnd_unwrapped(); diff --git a/src/dispatch_common.h b/src/dispatch_common.h index 6b8503a..eea4e8f 100644 --- a/src/dispatch_common.h +++ b/src/dispatch_common.h @@ -77,11 +77,11 @@ #endif #define UNWRAPPED_PROTO(x) (GLAPIENTRY *x) -#define WRAPPER_VISIBILITY static GLAPIENTRY +#define WRAPPER_VISIBILITY(type) static type GLAPIENTRY #define WRAPPER(x) x ## _wrapped #define GEN_GLOBAL_REWRITE_PTR(name, args, passthrough) \ - static EPOXY_CALLSPEC void \ + static void EPOXY_CALLSPEC \ name##_global_rewrite_ptr args \ { \ name = (void *)name##_resolver(); \ @@ -89,7 +89,7 @@ } #define GEN_GLOBAL_REWRITE_PTR_RET(ret, name, args, passthrough) \ - static EPOXY_CALLSPEC ret \ + static ret EPOXY_CALLSPEC \ name##_global_rewrite_ptr args \ { \ name = (void *)name##_resolver(); \ @@ -98,7 +98,7 @@ #if USING_DISPATCH_TABLE #define GEN_DISPATCH_TABLE_REWRITE_PTR(name, args, passthrough) \ - static EPOXY_CALLSPEC void \ + static void EPOXY_CALLSPEC \ name##_dispatch_table_rewrite_ptr args \ { \ struct dispatch_table *dispatch_table = get_dispatch_table(); \ @@ -108,7 +108,7 @@ } #define GEN_DISPATCH_TABLE_REWRITE_PTR_RET(ret, name, args, passthrough) \ - static EPOXY_CALLSPEC ret \ + static ret EPOXY_CALLSPEC \ name##_dispatch_table_rewrite_ptr args \ { \ struct dispatch_table *dispatch_table = get_dispatch_table(); \ @@ -118,14 +118,14 @@ } #define GEN_DISPATCH_TABLE_THUNK(name, args, passthrough) \ - static EPOXY_CALLSPEC void \ + static void EPOXY_CALLSPEC \ name##_dispatch_table_thunk args \ { \ get_dispatch_table()->name passthrough; \ } #define GEN_DISPATCH_TABLE_THUNK_RET(ret, name, args, passthrough) \ - static EPOXY_CALLSPEC ret \ + static ret EPOXY_CALLSPEC \ name##_dispatch_table_thunk args \ { \ return get_dispatch_table()->name passthrough; \ diff --git a/src/dispatch_wgl.c b/src/dispatch_wgl.c index 2bc5fc1..bfe9bb1 100644 --- a/src/dispatch_wgl.c +++ b/src/dispatch_wgl.c @@ -141,7 +141,7 @@ DllMain(HINSTANCE dll, DWORD reason, LPVOID reserved) return TRUE; } -WRAPPER_VISIBILITY BOOL +WRAPPER_VISIBILITY (BOOL) WRAPPER(epoxy_wglMakeCurrent)(HDC hdc, HGLRC hglrc) { BOOL ret = epoxy_wglMakeCurrent_unwrapped(hdc, hglrc); @@ -152,7 +152,7 @@ WRAPPER(epoxy_wglMakeCurrent)(HDC hdc, HGLRC hglrc) } -WRAPPER_VISIBILITY BOOL +WRAPPER_VISIBILITY (BOOL) WRAPPER(epoxy_wglMakeContextCurrentARB)(HDC hDrawDC, HDC hReadDC, HGLRC hglrc) @@ -166,7 +166,7 @@ WRAPPER(epoxy_wglMakeContextCurrentARB)(HDC hDrawDC, } -WRAPPER_VISIBILITY BOOL +WRAPPER_VISIBILITY (BOOL) WRAPPER(epoxy_wglMakeContextCurrentEXT)(HDC hDrawDC, HDC hReadDC, HGLRC hglrc) @@ -180,7 +180,7 @@ WRAPPER(epoxy_wglMakeContextCurrentEXT)(HDC hDrawDC, } -WRAPPER_VISIBILITY BOOL +WRAPPER_VISIBILITY (BOOL) WRAPPER(epoxy_wglMakeAssociatedContextCurrentAMD)(HGLRC hglrc) { BOOL ret = epoxy_wglMakeAssociatedContextCurrentAMD_unwrapped(hglrc);