def printRealHeader(self): print "" print "#include <GL/gl.h>" print '#include "indirect_size.h"' print "" glX_XML.printPure() print "" glX_XML.printFastcall() print "" glX_XML.printVisibility("INTERNAL", "internal") print "" print "" print "#ifdef HAVE_ALIAS" print "# define ALIAS2(from,to) \\" print " INTERNAL PURE FASTCALL GLint __gl ## from ## _size( GLenum e ) \\" print " __attribute__ ((alias( # to )));" print "# define ALIAS(from,to) ALIAS2( from, __gl ## to ## _size )" print "#else" print "# define ALIAS(from,to) \\" print " INTERNAL PURE FASTCALL GLint __gl ## from ## _size( GLenum e ) \\" print " { return __gl ## to ## _size( e ); }" print "#endif" print "" print ""
def printRealHeader(self): print """ /** * \\file * Prototypes for functions used to determine the number of data elements in * various GLX protocol messages. * * \\author Ian Romanick <*****@*****.**> */ #if !defined( _GLXSIZE_H_ ) # define _GLXSIZE_H_ """ glX_XML.printPure() print "" glX_XML.printFastcall() print "" glX_XML.printVisibility("INTERNAL", "internal") print ""
def printRealHeader(self): print "" print "#include <GL/gl.h>" print '#include "indirect.h"' print '#include "glxclient.h"' print '#include "size.h"' print "#include <GL/glxproto.h>" print "" print "#define __GLX_PAD(n) (((n) + 3) & ~3)" print "" glX_XML.printFastcall() glX_XML.printNoinline() print "" print "#if !defined __GNUC__ || __GNUC__ < 3" print "# define __builtin_expect(x, y) x" print "#endif" print "" print "/* If the size and opcode values are known at compile-time, this will, on" print " * x86 at least, emit them with a single instruction." print " */" print "#define emit_header(dest, op, size) \\" print " do { union { short s[2]; int i; } temp; \\" print " temp.s[0] = (size); temp.s[1] = (op); \\" print " *((int *)(dest)) = temp.i; } while(0)" print "" print """static NOINLINE CARD32 read_reply( Display *dpy, size_t size, void * dest, GLboolean reply_is_always_array ) { xGLXSingleReply reply; (void) _XReply(dpy, (xReply *) & reply, 0, False); if (size != 0) { if ((reply.length > 0) || reply_is_always_array) { const GLint bytes = (reply_is_always_array) ? (4 * reply.length) : (reply.size * size); const GLint extra = 4 - (bytes & 3); _XRead(dpy, dest, bytes); if ( extra < 4 ) { _XEatData(dpy, extra); } } else { (void) memcpy( dest, &(reply.pad3), size); } } return reply.retval; } #define X_GLXSingle 0 static NOINLINE FASTCALL GLubyte * setup_single_request( __GLXcontext * gc, GLint sop, GLint cmdlen ) { xGLXSingleReq * req; Display * const dpy = gc->currentDpy; (void) __glXFlushRenderBuffer(gc, gc->pc); LockDisplay(dpy); GetReqExtra(GLXSingle, cmdlen, req); req->reqType = gc->majorOpcode; req->contextTag = gc->currentContextTag; req->glxCode = sop; return (GLubyte *)(req) + sz_xGLXSingleReq; } static NOINLINE FASTCALL GLubyte * setup_vendor_request( __GLXcontext * gc, GLint code, GLint vop, GLint cmdlen ) { xGLXVendorPrivateReq * req; Display * const dpy = gc->currentDpy; (void) __glXFlushRenderBuffer(gc, gc->pc); LockDisplay(dpy); GetReqExtra(GLXVendorPrivate, cmdlen, req); req->reqType = gc->majorOpcode; req->glxCode = code; req->vendorCode = vop; req->contextTag = gc->currentContextTag; return (GLubyte *)(req) + sz_xGLXVendorPrivateReq; } """ for size in self.generic_sizes: self.print_generic_function(size) return