From 5ca107a4f215b84176123fd7a2d5fe14508a9f62 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 4 Jan 2007 14:53:48 -0800 Subject: [PATCH] Use glxbyteorder.h in server-side source files. --- src/mesa/glapi/glX_proto_recv.py | 21 +-------------------- src/mesa/glapi/glX_proto_size.py | 12 ++---------- 2 files changed, 3 insertions(+), 30 deletions(-) diff --git a/src/mesa/glapi/glX_proto_recv.py b/src/mesa/glapi/glX_proto_recv.py index 527f6f10eef..20f75575cf1 100644 --- a/src/mesa/glapi/glX_proto_recv.py +++ b/src/mesa/glapi/glX_proto_recv.py @@ -81,31 +81,12 @@ class PrintGlxDispatchFunctions(glX_proto_common.glx_print_proto): print '#include ' print '#include ' - - # FIXME: Since this block will require changes as other - # FIXME: platforms are added, it should probably be in a - # FIXME: header file that is not generated by a script. - - if self.do_swap: - print '#ifdef __linux__' - print '#include ' - print '#elif defined(__OpenBSD__)' - print '#include ' - print '#define bswap_16 __swap16' - print '#define bswap_32 __swap32' - print '#define bswap_64 __swap64' - print '#else' - print '#include ' - print '#define bswap_16 bswap16' - print '#define bswap_32 bswap32' - print '#define bswap_64 bswap64' - print '#endif' - print '#include ' print '#include "indirect_size.h"' print '#include "indirect_size_get.h"' print '#include "indirect_dispatch.h"' print '#include "glxserver.h"' + print '#include "glxbyteorder.h"' print '#include "indirect_util.h"' print '#include "singlesize.h"' print '#include "glapitable.h"' diff --git a/src/mesa/glapi/glX_proto_size.py b/src/mesa/glapi/glX_proto_size.py index 18bfa1b71bc..2b9a6433622 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 -- 2.30.2