[waffle] [PATCH 27/33] examples/simple-x11-egl: properly annotate the function pointers

Emil Velikov emil.l.velikov at gmail.com
Mon Jul 7 10:28:34 PDT 2014


Windows uses a different calling convention than linux for their public API
(__stdcall vs __cdelc). Properly annotate the pointers until waffle becomes
aware how to deal with GL dispatch.

Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
 examples/simple-x11-egl.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/examples/simple-x11-egl.c b/examples/simple-x11-egl.c
index ed26eaa..9e218ac 100644
--- a/examples/simple-x11-egl.c
+++ b/examples/simple-x11-egl.c
@@ -49,8 +49,16 @@ enum {
     GL_COLOR_BUFFER_BIT = 0x00004000,
 };
 
-static void (*glClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
-static void (*glClear)(GLbitfield mask);
+#ifndef _WIN32
+#define APIENTRY
+#else
+#ifndef APIENTRY
+#define APIENTRY __stdcall
+#endif
+#endif
+
+static void (APIENTRY *glClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+static void (APIENTRY *glClear)(GLbitfield mask);
 
 // ---------------------------------------------
 
-- 
2.0.0



More information about the waffle mailing list