[cogl/cogl.windows.fixes: 1/4] cogl-winsys-sdl2.c: Fix running on 32-bit Windows



commit eb2166dd62798404867181cc6e56165a7c48eee3
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Mon Feb 11 17:36:02 2019 +0800

    cogl-winsys-sdl2.c: Fix running on 32-bit Windows
    
    When we query for GL APIs, we need to ensure that we are using the
    correct calling convention, otherwise running on 32-bit Windows will
    crash.

 cogl/winsys/cogl-winsys-sdl2.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/cogl/winsys/cogl-winsys-sdl2.c b/cogl/winsys/cogl-winsys-sdl2.c
index c6661d93..b9ae6b2b 100644
--- a/cogl/winsys/cogl-winsys-sdl2.c
+++ b/cogl/winsys/cogl-winsys-sdl2.c
@@ -48,6 +48,10 @@
 #include "cogl-poll-private.h"
 #include "cogl-sdl.h"
 
+#ifndef APIENTRY
+# define APIENTRY
+#endif
+
 typedef struct _CoglContextSdl2
 {
   SDL_Window *current_window;
@@ -158,7 +162,7 @@ _cogl_winsys_display_setup (CoglDisplay *display,
                             CoglError **error)
 {
   CoglDisplaySdl2 *sdl_display;
-  const char * (* get_string_func) (GLenum name);
+  const char * (APIENTRY * get_string_func) (GLenum name);
   const char *gl_version;
 
   _COGL_RETURN_VAL_IF_FAIL (display->winsys == NULL, FALSE);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]