diff options
author | marha <marha@users.sourceforge.net> | 2011-05-22 14:29:51 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-05-22 14:29:51 +0000 |
commit | 016747a04df9d4474489fe3b3d1c0f11a713148b (patch) | |
tree | 69722f37ac06c00d6674c7bf2df6597753b418e6 /mesalib/src/mapi/glapi/gen/gl_table.py | |
parent | 32a666fa1f26defd3b4e508b75f1acf6e2900a40 (diff) | |
parent | 52011cfedaa930d61d8f60b283a2051093727582 (diff) | |
download | vcxsrv-016747a04df9d4474489fe3b3d1c0f11a713148b.tar.gz vcxsrv-016747a04df9d4474489fe3b3d1c0f11a713148b.tar.bz2 vcxsrv-016747a04df9d4474489fe3b3d1c0f11a713148b.zip |
svn merge ^/branches/released .
Diffstat (limited to 'mesalib/src/mapi/glapi/gen/gl_table.py')
-rw-r--r-- | mesalib/src/mapi/glapi/gen/gl_table.py | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/mesalib/src/mapi/glapi/gen/gl_table.py b/mesalib/src/mapi/glapi/gen/gl_table.py index 6325341b5..a1a9186a4 100644 --- a/mesalib/src/mapi/glapi/gen/gl_table.py +++ b/mesalib/src/mapi/glapi/gen/gl_table.py @@ -98,6 +98,9 @@ class PrintRemapTable(gl_XML.gl_print_base): return
def printBody(self, api):
+ print '#ifdef _MSC_VER'
+ print '#define INLINE __inline'
+ print '#endif'
print '#define CALL_by_offset(disp, cast, offset, parameters) \\'
print ' (*(cast (GET_by_offset(disp, offset)))) parameters'
print '#define GET_by_offset(disp, offset) \\'
@@ -167,11 +170,18 @@ class PrintRemapTable(gl_XML.gl_print_base): for f, index in abi_functions + functions:
arg_string = gl_XML.create_parameter_string( f.parameters, 0 )
- cast = '%s (GLAPIENTRYP)(%s)' % (f.return_type, arg_string)
- print '#define CALL_%s(disp, parameters) CALL_by_offset(disp, (%s), _gloffset_%s, parameters)' % (f.name, cast, f.name)
- print '#define GET_%s(disp) GET_by_offset(disp, _gloffset_%s)' % (f.name, f.name)
- print '#define SET_%s(disp, fn) SET_by_offset(disp, _gloffset_%s, fn)' % (f.name, f.name)
+ print 'typedef %s (GLAPIENTRYP _glptr_%s)(%s);' % (f.return_type, f.name, arg_string)
+ print '#define CALL_%s(disp, parameters) \\' % (f.name)
+ print ' (* GET_%s(disp)) parameters' % (f.name)
+ print 'static INLINE _glptr_%s GET_%s(struct _glapi_table *disp) {' % (f.name, f.name)
+ print ' return (_glptr_%s) (GET_by_offset(disp, _gloffset_%s));' % (f.name, f.name)
+ print '}'
+ print
+ print 'static INLINE void SET_%s(struct _glapi_table *disp, %s (GLAPIENTRYP fn)(%s)) {' % (f.name, f.return_type, arg_string)
+ print ' SET_by_offset(disp, _gloffset_%s, fn);' % (f.name)
+ print '}'
+ print
if alias_functions:
print ''
|