summaryrefslogtreecommitdiffstats
path: root/src/mapi
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2010-08-23 16:13:12 +0800
committerChia-I Wu <[email protected]>2010-08-23 18:28:14 +0800
commite607b67ebc0d15f6709fc8f9c79afeeda8ac1031 (patch)
treebcf25bdb43346c4760eb4b29938ad64c45195bb6 /src/mapi
parent0c878280506767c38887b71b45af2cb64a0f4abd (diff)
glapi: Clean up header inclusions.
Do not rely on PUBLIC being defined in glapi.h. Do not include core mesa headers.
Diffstat (limited to 'src/mapi')
-rw-r--r--src/mapi/glapi/glapi.h21
-rw-r--r--src/mapi/glapi/glapi_dispatch.c11
-rw-r--r--src/mapi/glapi/glapi_entrypoint.c9
-rw-r--r--src/mapi/glapi/glapi_getproc.c9
-rw-r--r--src/mapi/glapi/glapi_nop.c10
-rw-r--r--src/mapi/glapi/glapi_priv.h25
6 files changed, 45 insertions, 40 deletions
diff --git a/src/mapi/glapi/glapi.h b/src/mapi/glapi/glapi.h
index 1f18bf00fd9..a0bb0781063 100644
--- a/src/mapi/glapi/glapi.h
+++ b/src/mapi/glapi/glapi.h
@@ -45,7 +45,26 @@
#define _GLAPI_H
-#define _GLAPI_EXPORT PUBLIC
+/* opengl.dll does not export _glapi_* */
+#if defined(_WIN32)
+#define _GLAPI_NO_EXPORTS
+#endif
+
+#ifdef _GLAPI_NO_EXPORTS
+# define _GLAPI_EXPORT
+#else /* _GLAPI_NO_EXPORTS */
+# ifdef _WIN32
+# ifdef _GLAPI_DLL_EXPORTS
+# define _GLAPI_EXPORT __declspec(dllexport)
+# else
+# define _GLAPI_EXPORT __declspec(dllimport)
+# endif
+# elif defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
+# define _GLAPI_EXPORT __attribute__((visibility("default")))
+# else
+# define _GLAPI_EXPORT
+# endif
+#endif /* _GLAPI_NO_EXPORTS */
/* Is this needed? It is incomplete anyway. */
diff --git a/src/mapi/glapi/glapi_dispatch.c b/src/mapi/glapi/glapi_dispatch.c
index ae59140ad3a..7421a36d35a 100644
--- a/src/mapi/glapi/glapi_dispatch.c
+++ b/src/mapi/glapi/glapi_dispatch.c
@@ -37,18 +37,9 @@
* \author Brian Paul <[email protected]>
*/
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#include "glapi/mesa.h"
-#else
-#include "main/glheader.h"
-#include "main/compiler.h"
-#endif
-
-#include "glapi/glapi.h"
+#include "glapi/glapi_priv.h"
#include "glapi/glapitable.h"
#include "glapi/glapidispatch.h"
-#include "glapi/glthread.h"
#if !(defined(USE_X86_ASM) || defined(USE_X86_64_ASM) || defined(USE_SPARC_ASM))
diff --git a/src/mapi/glapi/glapi_entrypoint.c b/src/mapi/glapi/glapi_entrypoint.c
index 82c68c27c8b..993ccb94c24 100644
--- a/src/mapi/glapi/glapi_entrypoint.c
+++ b/src/mapi/glapi/glapi_entrypoint.c
@@ -29,15 +29,6 @@
*/
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#include "glapi/mesa.h"
-#else
-#include "main/glheader.h"
-#include "main/compiler.h"
-#endif
-
-#include "glapi/glapi.h"
#include "glapi/glapi_priv.h"
#include "mapi/u_execmem.h"
diff --git a/src/mapi/glapi/glapi_getproc.c b/src/mapi/glapi/glapi_getproc.c
index 3c134f929d6..dc4905b64e0 100644
--- a/src/mapi/glapi/glapi_getproc.c
+++ b/src/mapi/glapi/glapi_getproc.c
@@ -30,15 +30,6 @@
*/
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#include "glapi/mesa.h"
-#else
-#include "main/glheader.h"
-#include "main/compiler.h"
-#endif
-
-#include "glapi/glapi.h"
#include "glapi/glapi_priv.h"
#include "glapi/glapitable.h"
#include "glapi/glapioffsets.h"
diff --git a/src/mapi/glapi/glapi_nop.c b/src/mapi/glapi/glapi_nop.c
index df46ca8c89a..9b092971506 100644
--- a/src/mapi/glapi/glapi_nop.c
+++ b/src/mapi/glapi/glapi_nop.c
@@ -38,15 +38,7 @@
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#include "glapi/mesa.h"
-#else
-#include "main/compiler.h"
-#include "main/glheader.h"
-#endif
-
-#include "glapi/glapi.h"
+#include "glapi/glapi_priv.h"
void
diff --git a/src/mapi/glapi/glapi_priv.h b/src/mapi/glapi/glapi_priv.h
index 1c2a7042113..89f81c723e9 100644
--- a/src/mapi/glapi/glapi_priv.h
+++ b/src/mapi/glapi/glapi_priv.h
@@ -26,9 +26,30 @@
#ifndef _GLAPI_PRIV_H
#define _GLAPI_PRIV_H
-#include "glthread.h"
-#include "glapi.h"
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#include "glapi/mesa.h"
+#else /* HAVE_DIX_CONFIG_H */
+#define GL_GLEXT_PROTOTYPES
+#include "GL/gl.h"
+#include "GL/glext.h"
+
+#ifndef GL_FIXED
+typedef int GLfixed;
+typedef int GLclampx;
+#endif
+
+#ifndef GL_OES_EGL_image
+typedef void *GLeglImageOES;
+#endif
+
+#endif /* HAVE_DIX_CONFIG_H */
+#include "glapi/glapi.h"
/* getproc */