From b3d9ed404fd92939782fd6ae4dee62dc86768270 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Tue, 2 Sep 2014 23:01:32 +0200
Subject: Fixup Glee for Haiku support.


diff --git a/src/modules/graphics/opengl/GLee.c b/src/modules/graphics/opengl/GLee.c
index f0d1beb..d3307a8 100644
--- a/src/modules/graphics/opengl/GLee.c
+++ b/src/modules/graphics/opengl/GLee.c
@@ -42,7 +42,7 @@
 #include <string.h>
 #include "GLee.h"
 
-#if defined(__APPLE__) || defined(__APPLE_CC__)
+#if defined(__APPLE__) || defined(__APPLE_CC__) || defined(__HAIKU__)
 #define GLEE_USE_SDL
 #ifdef GLEE_USE_SDL
 	#include <SDL2/SDL_video.h>
@@ -55,7 +55,7 @@ typedef GLuint(*GLEE_LINK_FUNCTION)(void);
 
 GLboolean __GLeeInited=GL_FALSE;
 
-#ifndef _WIN32
+#if !defined(_WIN32) && !defined(__HAIKU__)
 	#define __stdcall  /* nothing */
 #endif 
 
@@ -68,7 +68,7 @@ GLEE_FUNC __GLeeGetProcAddress(const char *extname)
 {
 #ifdef _WIN32
     return (GLEE_FUNC)wglGetProcAddress(extname);
-#elif defined(__APPLE__) || defined(__APPLE_CC__)
+#elif defined(__APPLE__) || defined(__APPLE_CC__) || defined(__HAIKU__)
 #if defined(GLEE_USE_SDL)
 	return SDL_GL_GetProcAddress(extname);
 #else
@@ -22418,7 +22418,7 @@ const char *__GLeeGetExtStrPlat( void )
 
 	if (wglGetExtensionsStringARB)
 		return (const char *)wglGetExtensionsStringARB(wglGetCurrentDC());
-#elif defined(__APPLE__) || defined(__APPLE_CC__)
+#elif defined(__APPLE__) || defined(__APPLE_CC__) || defined(__HAIKU__)
 #else
 	Display *dpy=glXGetCurrentDisplay();
 	if(dpy)
diff --git a/src/modules/graphics/opengl/GLee.h b/src/modules/graphics/opengl/GLee.h
index 07aadb1..92c3ef6 100644
--- a/src/modules/graphics/opengl/GLee.h
+++ b/src/modules/graphics/opengl/GLee.h
@@ -64,7 +64,10 @@
 	#define __glxext_h_ /* prevent glxext.h from being included */
 	#define GLX_GLXEXT_PROTOTYPES
 	#include <GL/gl.h>
+
+#ifndef __HAIKU__
 	#include <GL/glx.h>
+#endif
 
 	typedef XID GLEE_GLXContextID;
 #endif
@@ -1154,7 +1157,7 @@ GLEE_EXTERN GLboolean _GLEE_SGIX_igloo_interface;
 		DECLARE_HANDLE(HVIDEOINPUTDEVICENV);
 	#endif
 	
-#elif defined(__APPLE__) || defined(__APPLE_CC__)
+#elif defined(__APPLE__) || defined(__APPLE_CC__) || defined(__HAIKU__)
 
 	/* Mac OS X */
 
@@ -23180,7 +23183,7 @@ GLEE_EXTERN GLboolean _GLEE_WGL_NV_video_output;
   #define wglGetVideoInfoNV GLeeFuncPtr_wglGetVideoInfoNV
 #endif
 #endif 
-#elif defined(__APPLE__) || defined(__APPLE_CC__)
+#elif defined(__APPLE__) || defined(__APPLE_CC__) || defined(__HAIKU__)
 #else /* GLX */
 
 /* Extension querying variables */
-- 
1.8.3.4

