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.
macos/v1.5.9
Chun-wei Fan 9 years ago committed by Eric Anholt
parent e242497728
commit 7d5e8e9d56
  1. 4
      src/dispatch_common.c
  2. 14
      src/dispatch_common.h
  3. 8
      src/dispatch_wgl.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();

@ -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; \

@ -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);

Loading…
Cancel
Save