summaryrefslogtreecommitdiff
path: root/src/dispatch_common.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/dispatch_common.h')
-rw-r--r--src/dispatch_common.h49
1 files changed, 37 insertions, 12 deletions
diff --git a/src/dispatch_common.h b/src/dispatch_common.h
index 4e4414f..676a4d5 100644
--- a/src/dispatch_common.h
+++ b/src/dispatch_common.h
@@ -23,19 +23,48 @@
#include <stdbool.h>
-#include "epoxy/gl.h"
-
-#if EPOXY_SUPPORT_WGL
-#include "epoxy/wgl.h"
+#ifdef _WIN32
+#define PLATFORM_HAS_EGL 0
+#define PLATFORM_HAS_GLX 0
+#define PLATFORM_HAS_WGL 1
+#define EPOXY_IMPORTEXPORT __declspec(dllexport)
+#elif defined(__APPLE__)
+#define PLATFORM_HAS_EGL 0
+#define PLATFORM_HAS_GLX 0
+#define PLATFORM_HAS_WGL 0
+#define EPOXY_IMPORTEXPORT
+#elif defined(ANDROID)
+#define PLATFORM_HAS_EGL 1
+#define PLATFORM_HAS_GLX 0
+#define PLATFORM_HAS_WGL 0
+#define EPOXY_IMPORTEXPORT
+#else
+#define PLATFORM_HAS_EGL 1
+#define PLATFORM_HAS_GLX 1
+#define PLATFORM_HAS_WGL 0
+#define EPOXY_IMPORTEXPORT
#endif
-#if EPOXY_SUPPORT_GLX
+#include "epoxy/gl.h"
+#if PLATFORM_HAS_GLX
#include "epoxy/glx.h"
#endif
-
-#if EPOXY_SUPPORT_EGL
+#if PLATFORM_HAS_EGL
#include "epoxy/egl.h"
#endif
+#if PLATFORM_HAS_WGL
+#include "epoxy/wgl.h"
+#endif
+
+#ifndef PUBLIC
+# ifdef _WIN32
+# define PUBLIC __declspec(dllexport)
+# elif (defined(__GNUC__) && __GNUC__ >= 4) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
+# define PUBLIC __attribute__((visibility("default")))
+# else
+# define PUBLIC
+# endif
+#endif
#if defined(__GNUC__)
#define PACKED __attribute__((__packed__))
@@ -166,8 +195,4 @@ extern BOOL UNWRAPPED_PROTO(wglMakeCurrent_unwrapped)(HDC hdc, HGLRC hglrc);
extern BOOL UNWRAPPED_PROTO(wglMakeContextCurrentARB_unwrapped)(HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
extern BOOL UNWRAPPED_PROTO(wglMakeContextCurrentEXT_unwrapped)(HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
extern BOOL UNWRAPPED_PROTO(wglMakeAssociatedContextCurrentAMD_unwrapped)(HGLRC hglrc);
-#endif /* _WIN32 */
-
-#if EPOXY_SUPPORT_WGL
-extern bool epoxy_first_context_current;
-#endif
+#endif /* _WIN32_ */