summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChun-wei Fan <fanchunwei@src.gnome.org>2019-02-11 17:36:02 +0800
committerChun-wei Fan <fanchunwei@src.gnome.org>2020-11-20 11:04:00 +0800
commit464ec64ac6ab9d069031ebda0fc9caf0de0fbf2b (patch)
treec41b2a0d138a324e8943f96f7ead8bbcc2fe85be
parent62c4b62572941180f46202d685aac1f3efb40462 (diff)
downloadcogl-464ec64ac6ab9d069031ebda0fc9caf0de0fbf2b.tar.gz
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.
-rw-r--r--cogl/winsys/cogl-winsys-sdl2.c6
1 files changed, 5 insertions, 1 deletions
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);