X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fglapi%2FglX_proto_size.py;h=95cb5110cc3cc8d7dd08619883a90ddd33d15432;hb=507f4e7a7448fb246febefe8819b7b3ac70a35b4;hp=18bfa1b71bca6aa7ca866a95689a3a8a5a2607c0;hpb=e3358dea660f5dec53a8be9e38d725f4fd829e14;p=mesa.git diff --git a/src/mesa/glapi/glX_proto_size.py b/src/mesa/glapi/glX_proto_size.py index 18bfa1b71bc..95cb5110cc3 100644 --- a/src/mesa/glapi/glX_proto_size.py +++ b/src/mesa/glapi/glX_proto_size.py @@ -447,17 +447,9 @@ class PrintGlxReqSize_c(PrintGlxReqSize_common): print '' print '#include ' print '#include "glxserver.h"' + print '#include "glxbyteorder.h"' print '#include "indirect_size.h"' print '#include "indirect_reqsize.h"' - print '' - print '#if defined(linux)' - print '# include ' - print '# define SWAP_32(v) do { (v) = bswap_32(v); } while(0)' - print '#else' - print '# include ' - print '# define SWAP_32(v) do { char tmp; swapl(&v, tmp); } while(0)' - print '#endif' - print '' print '#define __GLX_PAD(x) (((x) + 3) & ~3)' print '' @@ -538,7 +530,7 @@ class PrintGlxReqSize_c(PrintGlxReqSize_common): if fixup: print ' if (swap) {' for name in fixup: - print ' SWAP_32( %s );' % (name) + print ' %s = bswap_32(%s);' % (name, name) print ' }' return @@ -589,6 +581,11 @@ class PrintGlxReqSize_c(PrintGlxReqSize_common): self.common_emit_fixups(fixup) + if img.img_null_flag: + print '' + print ' if (*(CARD32 *) (pc + %s))' % (img.offset - 4) + print ' return 0;' + print '' print ' return __glXImageSize(%s, %s, %s, %s, %s, %s,' % (img.img_format, img.img_type, img.img_target, w, h, d ) print ' image_height, row_length, skip_images,'