aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/mesa
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-01-08 16:33:41 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-01-08 16:33:41 +0000
commit6f47663000b68849cd9df11c30985a2e6382e785 (patch)
tree50266bd62a39602014455ef04b7b888d1665b6fb /src/gpu/gl/mesa
parent37924183583cf3fdc59b91de0acc26e1fcf2598d (diff)
Fix macro redefinition warning on 10.6 bots in mesa code.
R=humper@google.com Review URL: https://codereview.appspot.com/7063050 git-svn-id: http://skia.googlecode.com/svn/trunk@7086 2bbb7eff-a529-9590-31e7-b0007b416f81
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>