Fix most GLhandleARB warnings on OS X with a big comment in our code.

macos/v1.5.9
Eric Anholt 11 years ago
parent 8d8334c350
commit 0cfb0a044b
  1. 4
      configure.ac
  2. 23
      src/gen_dispatch.py

@ -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

@ -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):

Loading…
Cancel
Save