Don't forget to tell our users that the epoxy GL functions are __dllimport.

This lets the compiler generate faster function calls (call through
function pointer, instead of call into a linker-generated stub func
containing jump to function pointer).
macos/v1.5.9
Eric Anholt 11 years ago
parent 920543faa4
commit 8022cda75d
  1. 5
      include/epoxy/gl.h
  2. 1
      src/dispatch_common.h
  3. 8
      src/gen_dispatch.py

@ -47,6 +47,7 @@ extern "C" {
/* APIENTRY and GLAPIENTRY are not used on Linux or Mac. */
#define APIENTRY
#define GLAPIENTRY
#define EPOXYAPIENTRY
#define GLAPI
#else
#ifndef APIENTRY
@ -57,6 +58,10 @@ extern "C" {
#define GLAPIENTRY APIENTRY
#endif
#ifndef EPOXYAPIENTRY
#define EPOXYAPIENTRY __declspec(dllimport)
#endif
#ifndef GLAPI
#define GLAPI extern
#endif

@ -27,6 +27,7 @@
#define PLATFORM_HAS_EGL 0
#define PLATFORM_HAS_GLX 0
#define PLATFORM_HAS_WGL 1
#define EPOXYAPIENTRY __declspec(dllexport)
#elif defined(__APPLE__)
#define PLATFORM_HAS_EGL 0
#define PLATFORM_HAS_GLX 1

@ -506,16 +506,14 @@ class Generator(object):
self.outln(' */')
self.outln('#ifdef _WIN32')
self.outln('#define EPOXY_FPTR(x) x')
self.outln('#define EPOXY_FPTR_EXTERN')
self.outln('#else')
self.outln('#define EPOXY_FPTR(x) (*x)')
self.outln('#define EPOXY_FPTR_EXTERN extern')
self.outln('#endif')
for func in self.sorted_functions:
self.outln('EPOXY_FPTR_EXTERN {0} EPOXY_FPTR(epoxy_{1})({2});'.format(func.ret_type,
func.name,
func.args_decl))
self.outln('extern EPOXYAPIENTRY {0} EPOXY_FPTR(epoxy_{1})({2});'.format(func.ret_type,
func.name,
func.args_decl))
self.outln('')
for func in self.sorted_functions:

Loading…
Cancel
Save