summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac4
-rwxr-xr-xsrc/gen_dispatch.py23
2 files changed, 25 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index c2815b7..f1d2b0f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -48,6 +48,10 @@ AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL
AC_SYS_LARGEFILE
+# OS X defaults to having -Wint-conversion ("warn when passing
+# uintptr_t to a void *") by default. Kill that.
+XORG_TESTSET_CFLAG(CWARNFLAGS, [-Wno-int-conversion])
+
case $host_os in
mingw*)
build_egl=no
diff --git a/src/gen_dispatch.py b/src/gen_dispatch.py
index 4bcf4e3..652dfff 100755
--- a/src/gen_dispatch.py
+++ b/src/gen_dispatch.py
@@ -107,12 +107,31 @@ class GLFunction(object):
elif name == "far":
name = "yon"
+ # Mac screwed up GLhandleARB and made it a void * instead of
+ # uint32_t, despite it being specced as only necessarily 32
+ # bits wide, causing portability problems all over. There are
+ # prototype conflicts between things like
+ # glAttachShader(GLuint program, GLuint shader) and
+ # glAttachObjectARB(GLhandleARB container, GLhandleARB obj),
+ # even though they are marked as aliases in the XML (and being
+ # aliases in Mesa).
+ #
+ # We retain those aliases. In the x86_64 ABI, the first 6
+ # args are stored in 64-bit registers, so the calls end up
+ # being the same despite the different types. We just need to
+ # add a cast to uintptr_t to shut up the compiler.
+ if type == 'GLhandleARB':
+ assert(len(self.args) < 6)
+ arg_list_name = '(uintptr_t)' + name
+ else:
+ arg_list_name = name
+
self.args.append((type, name))
if self.args_decl == 'void':
- self.args_list = name
+ self.args_list = arg_list_name
self.args_decl = type + ' ' + name
else:
- self.args_list += ', ' + name
+ self.args_list += ', ' + arg_list_name
self.args_decl += ', ' + type + ' ' + name
def add_provider(self, condition, loader, condition_name):