aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mapi/glapi/gen/gl_table.py
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mapi/glapi/gen/gl_table.py')
-rwxr-xr-x[-rw-r--r--]mesalib/src/mapi/glapi/gen/gl_table.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/mesalib/src/mapi/glapi/gen/gl_table.py b/mesalib/src/mapi/glapi/gen/gl_table.py
index fd384689f..0c9c0b8a1 100644..100755
--- a/mesalib/src/mapi/glapi/gen/gl_table.py
+++ b/mesalib/src/mapi/glapi/gen/gl_table.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python2
+#!/usr/bin/env python
# (C) Copyright IBM Corporation 2004
# All Rights Reserved.
@@ -87,6 +87,7 @@ class PrintRemapTable(gl_XML.gl_print_base):
def printRealHeader(self):
print """
+#include "glapitable.h"
/**
* \\file main/dispatch.h
* Macros for handling GL dispatch tables.
@@ -101,6 +102,11 @@ class PrintRemapTable(gl_XML.gl_print_base):
return
def printBody(self, api):
+ print '#ifdef _MSC_VER'
+ print '#ifndef INLINE'
+ print '#define INLINE __inline'
+ print '#endif'
+ 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) \\'
@@ -151,7 +157,7 @@ class PrintRemapTable(gl_XML.gl_print_base):
remap_table = "driDispatchRemapTable"
print '#define %s_size %u' % (remap_table, count)
- print 'extern int %s[ %s_size ];' % (remap_table, remap_table)
+ print 'SERVEXTERN int %s[ %s_size ];' % (remap_table, remap_table)
print ''
for f, index in functions:
@@ -170,11 +176,11 @@ class PrintRemapTable(gl_XML.gl_print_base):
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 '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 '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