-#!/usr/bin/env python
# (C) Copyright IBM Corporation 2005
# All Rights Reserved.
if not func.ignore and not func.vectorequiv:
if func.glx_rop:
print 'extern _X_HIDDEN void __glXDisp_%s(GLbyte * pc);' % (func.name)
- print 'extern _X_HIDDEN void __glXDispSwap_%s(GLbyte * pc);' % (func.name)
+ print 'extern _X_HIDDEN _X_COLD void __glXDispSwap_%s(GLbyte * pc);' % (func.name)
elif func.glx_sop or func.glx_vendorpriv:
print 'extern _X_HIDDEN int __glXDisp_%s(struct __GLXclientStateRec *, GLbyte *);' % (func.name)
- print 'extern _X_HIDDEN int __glXDispSwap_%s(struct __GLXclientStateRec *, GLbyte *);' % (func.name)
+ print 'extern _X_HIDDEN _X_COLD int __glXDispSwap_%s(struct __GLXclientStateRec *, GLbyte *);' % (func.name)
if func.glx_sop and func.glx_vendorpriv:
n = func.glx_vendorpriv_names[0]
print 'extern _X_HIDDEN int __glXDisp_%s(struct __GLXclientStateRec *, GLbyte *);' % (n)
- print 'extern _X_HIDDEN int __glXDispSwap_%s(struct __GLXclientStateRec *, GLbyte *);' % (n)
+ print 'extern _X_HIDDEN _X_COLD int __glXDispSwap_%s(struct __GLXclientStateRec *, GLbyte *);' % (n)
return
print '#include "indirect_util.h"'
print '#include "singlesize.h"'
print ''
- print '#define __GLX_PAD(x) (((x) + 3) & ~3)'
- print ''
print 'typedef struct {'
print ' __GLX_PIXEL_3D_HDR;'
print '} __GLXpixel3DHeader;'
return
+ def fptrType(self, name):
+ fptr = "pfngl" + name + "proc"
+ return fptr.upper()
def printFunction(self, f, name):
if (f.glx_sop or f.glx_vendorpriv) and (len(f.get_images()) != 0):
print '{'
+ if not f.is_abi():
+ print ' %s %s = __glGetProcAddress("gl%s");' % (self.fptrType(name), name, name)
+
if f.glx_rop or f.vectorequiv:
self.printRenderFunction(f)
elif f.glx_sop or f.glx_vendorpriv:
if t.glx_name not in already_done:
real_name = self.real_types[t_size]
- print 'static %s' % (t_name)
- print 'bswap_%s( const void * src )' % (t.glx_name)
+ print 'static _X_UNUSED %s' % (t_name)
+ print 'bswap_%s(const void * src)' % (t.glx_name)
print '{'
print ' union { %s dst; %s ret; } x;' % (real_name, t_name)
- print ' x.dst = bswap_%u( *(%s *) src );' % (t_size * 8, real_name)
+ print ' x.dst = bswap_%u(*(%s *) src);' % (t_size * 8, real_name)
print ' return x.ret;'
print '}'
print ''
for bits in [16, 32, 64]:
print 'static void *'
- print 'bswap_%u_array( uint%u_t * src, unsigned count )' % (bits, bits)
+ print 'bswap_%u_array(uint%u_t * src, unsigned count)' % (bits, bits)
print '{'
print ' unsigned i;'
print ''
- print ' for ( i = 0 ; i < count ; i++ ) {'
- print ' uint%u_t temp = bswap_%u( src[i] );' % (bits, bits)
+ print ' for (i = 0 ; i < count ; i++) {'
+ print ' uint%u_t temp = bswap_%u(src[i]);' % (bits, bits)
print ' src[i] = temp;'
print ' }'
print ''
def emit_function_call(self, f, retval_assign, indent):
list = []
+ prefix = "gl" if f.is_abi() else ""
for param in f.parameterIterator():
if param.is_padding:
list.append( '%s %s' % (indent, location) )
-
- print '%s %sgl%s(%s);' % (indent, retval_assign, f.name, string.join(list, ',\n'))
+ print '%s %s%s%s(%s);' % (indent, retval_assign, prefix, f.name, string.join(list, ',\n'))
def common_func_print_just_start(self, f, indent):
print ' %s %s = __glXGetAnswerBuffer(cl, %s%s, answerBuffer, sizeof(answerBuffer), %u);' % (param.type_string(), param.name, param.counter, size_scale, type_size)
answer_string = param.name
answer_count = param.counter
+ print ''
+ print ' if (%s == NULL) return BadAlloc;' % (param.name)
+ print ' __glXClearErrorOccured();'
+ print ''
elif c >= 1:
print ' %s %s[%u];' % (answer_type, param.name, c)
answer_string = param.name