aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/mesa
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/gl/mesa')
-rw-r--r--src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp2
-rw-r--r--src/gpu/gl/mesa/osmesa_wrapper.h16
2 files changed, 17 insertions, 1 deletions
diff --git a/src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp b/src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp
index 2f712e3650..1b4b7f6a37 100644
--- a/src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp
+++ b/src/gpu/gl/mesa/GrGLCreateMesaInterface.cpp
@@ -11,7 +11,7 @@
#include "../GrGLUtil.h"
#define GL_GLEXT_PROTOTYPES
-#include <GL/osmesa.h>
+#include "osmesa_wrapper.h"
#define GR_GL_GET_PROC(F) interface->f ## F = (GrGL ## F ## Proc) \
OSMesaGetProcAddress("gl" #F);
diff --git a/src/gpu/gl/mesa/osmesa_wrapper.h b/src/gpu/gl/mesa/osmesa_wrapper.h
new file mode 100644
index 0000000000..70de99376d
--- /dev/null
+++ b/src/gpu/gl/mesa/osmesa_wrapper.h
@@ -0,0 +1,16 @@
+
+/*
+ * Copyright 2013 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+// Older versions of XQuartz have a bug where a header included by osmesa.h
+// defines GL_GLEXT_PROTOTYPES. This will cause a redefinition warning if
+// the file that includes osmesa.h already defined it. XCode 3 uses a version
+// of gcc (4.2.1) that does not support the diagnostic pragma to disable a
+// warning (added in 4.2.4). So we use the system_header pragma to shut GCC
+// up about warnings in osmesa.h
+#pragma GCC system_header
+#include <GL/osmesa.h>