956a0e3c076406b83d635174a201fd8761ee5133vboxsync#ifndef __GLX_unpack_h__
956a0e3c076406b83d635174a201fd8761ee5133vboxsync#define __GLX_unpack_h__
956a0e3c076406b83d635174a201fd8761ee5133vboxsync
956a0e3c076406b83d635174a201fd8761ee5133vboxsync/*
956a0e3c076406b83d635174a201fd8761ee5133vboxsync * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
956a0e3c076406b83d635174a201fd8761ee5133vboxsync * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
c7814cf6e1240a519cbec0441e033d0e2470ed00vboxsync *
956a0e3c076406b83d635174a201fd8761ee5133vboxsync * Permission is hereby granted, free of charge, to any person obtaining a
956a0e3c076406b83d635174a201fd8761ee5133vboxsync * copy of this software and associated documentation files (the "Software"),
956a0e3c076406b83d635174a201fd8761ee5133vboxsync * to deal in the Software without restriction, including without limitation
956a0e3c076406b83d635174a201fd8761ee5133vboxsync * the rights to use, copy, modify, merge, publish, distribute, sublicense,
956a0e3c076406b83d635174a201fd8761ee5133vboxsync * and/or sell copies of the Software, and to permit persons to whom the
956a0e3c076406b83d635174a201fd8761ee5133vboxsync * Software is furnished to do so, subject to the following conditions:
956a0e3c076406b83d635174a201fd8761ee5133vboxsync *
956a0e3c076406b83d635174a201fd8761ee5133vboxsync * The above copyright notice including the dates of first publication and
956a0e3c076406b83d635174a201fd8761ee5133vboxsync * either this permission notice or a reference to
956a0e3c076406b83d635174a201fd8761ee5133vboxsync * http://oss.sgi.com/projects/FreeB/
956a0e3c076406b83d635174a201fd8761ee5133vboxsync * shall be included in all copies or substantial portions of the Software.
956a0e3c076406b83d635174a201fd8761ee5133vboxsync *
956a0e3c076406b83d635174a201fd8761ee5133vboxsync * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
956a0e3c076406b83d635174a201fd8761ee5133vboxsync * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
956a0e3c076406b83d635174a201fd8761ee5133vboxsync * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
956a0e3c076406b83d635174a201fd8761ee5133vboxsync * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
956a0e3c076406b83d635174a201fd8761ee5133vboxsync * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
956a0e3c076406b83d635174a201fd8761ee5133vboxsync * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
956a0e3c076406b83d635174a201fd8761ee5133vboxsync * SOFTWARE.
68fb2428898c55a7172e6a75a0a8d7ce259919bdvboxsync *
68fb2428898c55a7172e6a75a0a8d7ce259919bdvboxsync * Except as contained in this notice, the name of Silicon Graphics, Inc.
68fb2428898c55a7172e6a75a0a8d7ce259919bdvboxsync * shall not be used in advertising or otherwise to promote the sale, use or
68fb2428898c55a7172e6a75a0a8d7ce259919bdvboxsync * other dealings in this Software without prior written authorization from
956a0e3c076406b83d635174a201fd8761ee5133vboxsync * Silicon Graphics, Inc.
956a0e3c076406b83d635174a201fd8761ee5133vboxsync */
956a0e3c076406b83d635174a201fd8761ee5133vboxsync
956a0e3c076406b83d635174a201fd8761ee5133vboxsync#define __GLX_PAD(s) (((s)+3) & (GLuint)~3)
956a0e3c076406b83d635174a201fd8761ee5133vboxsync
956a0e3c076406b83d635174a201fd8761ee5133vboxsync/*
956a0e3c076406b83d635174a201fd8761ee5133vboxsync** Fetch the context-id out of a SingleReq request pointed to by pc.
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync*/
956a0e3c076406b83d635174a201fd8761ee5133vboxsync#define __GLX_GET_SINGLE_CONTEXT_TAG(pc) (((xGLXSingleReq*)pc)->contextTag)
956a0e3c076406b83d635174a201fd8761ee5133vboxsync#define __GLX_GET_VENDPRIV_CONTEXT_TAG(pc) (((xGLXVendorPrivateReq*)pc)->contextTag)
956a0e3c076406b83d635174a201fd8761ee5133vboxsync
956a0e3c076406b83d635174a201fd8761ee5133vboxsync/*
956a0e3c076406b83d635174a201fd8761ee5133vboxsync** Fetch a double from potentially unaligned memory.
956a0e3c076406b83d635174a201fd8761ee5133vboxsync*/
956a0e3c076406b83d635174a201fd8761ee5133vboxsync#ifdef __GLX_ALIGN64
956a0e3c076406b83d635174a201fd8761ee5133vboxsync#define __GLX_MEM_COPY(dst,src,n) memmove(dst,src,n)
956a0e3c076406b83d635174a201fd8761ee5133vboxsync#define __GLX_GET_DOUBLE(dst,src) __GLX_MEM_COPY(&dst,src,8)
956a0e3c076406b83d635174a201fd8761ee5133vboxsync#else
956a0e3c076406b83d635174a201fd8761ee5133vboxsync#define __GLX_GET_DOUBLE(dst,src) (dst) = *((GLdouble*)(src))
956a0e3c076406b83d635174a201fd8761ee5133vboxsync#endif
956a0e3c076406b83d635174a201fd8761ee5133vboxsync
956a0e3c076406b83d635174a201fd8761ee5133vboxsyncextern void __glXMemInit(void);
956a0e3c076406b83d635174a201fd8761ee5133vboxsync
956a0e3c076406b83d635174a201fd8761ee5133vboxsyncextern xGLXSingleReply __glXReply;
956a0e3c076406b83d635174a201fd8761ee5133vboxsync
956a0e3c076406b83d635174a201fd8761ee5133vboxsync#define __GLX_BEGIN_REPLY(size) \
956a0e3c076406b83d635174a201fd8761ee5133vboxsync __glXReply.length = __GLX_PAD(size) >> 2; \
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync __glXReply.type = X_Reply; \
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync __glXReply.sequenceNumber = client->sequence;
956a0e3c076406b83d635174a201fd8761ee5133vboxsync
956a0e3c076406b83d635174a201fd8761ee5133vboxsync#define __GLX_SEND_HEADER() \
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync WriteToClient (client, sz_xGLXSingleReply, &__glXReply);
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync
956a0e3c076406b83d635174a201fd8761ee5133vboxsync#define __GLX_PUT_RETVAL(a) \
956a0e3c076406b83d635174a201fd8761ee5133vboxsync __glXReply.retval = (a);
956a0e3c076406b83d635174a201fd8761ee5133vboxsync
956a0e3c076406b83d635174a201fd8761ee5133vboxsync#define __GLX_PUT_SIZE(a) \
956a0e3c076406b83d635174a201fd8761ee5133vboxsync __glXReply.size = (a);
956a0e3c076406b83d635174a201fd8761ee5133vboxsync
956a0e3c076406b83d635174a201fd8761ee5133vboxsync#define __GLX_PUT_RENDERMODE(m) \
956a0e3c076406b83d635174a201fd8761ee5133vboxsync __glXReply.pad3 = (m)
956a0e3c076406b83d635174a201fd8761ee5133vboxsync
956a0e3c076406b83d635174a201fd8761ee5133vboxsync/*
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync** Get a buffer to hold returned data, with the given alignment. If we have
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync** to realloc, allocate size+align, in case the pointer has to be bumped for
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync** alignment. The answerBuffer should already be aligned.
956a0e3c076406b83d635174a201fd8761ee5133vboxsync**
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync** NOTE: the cast (long)res below assumes a long is large enough to hold a
956a0e3c076406b83d635174a201fd8761ee5133vboxsync** pointer.
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync*/
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync#define __GLX_GET_ANSWER_BUFFER(res,cl,size,align) \
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync if ((size) > sizeof(answerBuffer)) { \
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync int bump; \
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync if ((cl)->returnBufSize < (size)+(align)) { \
956a0e3c076406b83d635174a201fd8761ee5133vboxsync (cl)->returnBuf = (GLbyte*)realloc((cl)->returnBuf, \
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync (size)+(align)); \
956a0e3c076406b83d635174a201fd8761ee5133vboxsync if (!(cl)->returnBuf) { \
956a0e3c076406b83d635174a201fd8761ee5133vboxsync return BadAlloc; \
956a0e3c076406b83d635174a201fd8761ee5133vboxsync } \
956a0e3c076406b83d635174a201fd8761ee5133vboxsync (cl)->returnBufSize = (size)+(align); \
956a0e3c076406b83d635174a201fd8761ee5133vboxsync } \
956a0e3c076406b83d635174a201fd8761ee5133vboxsync res = (char*)cl->returnBuf; \
956a0e3c076406b83d635174a201fd8761ee5133vboxsync bump = (long)(res) % (align); \
68fb2428898c55a7172e6a75a0a8d7ce259919bdvboxsync if (bump) res += (align) - (bump); \
68fb2428898c55a7172e6a75a0a8d7ce259919bdvboxsync } else { \
f5f42fa2ec9924006cad8e5adc646b34b35ba3c3vboxsync res = (char *)answerBuffer; \
956a0e3c076406b83d635174a201fd8761ee5133vboxsync }
956a0e3c076406b83d635174a201fd8761ee5133vboxsync
956a0e3c076406b83d635174a201fd8761ee5133vboxsync#define __GLX_PUT_BYTE() \
956a0e3c076406b83d635174a201fd8761ee5133vboxsync *(GLbyte *)&__glXReply.pad3 = *(GLbyte *)answer
956a0e3c076406b83d635174a201fd8761ee5133vboxsync
956a0e3c076406b83d635174a201fd8761ee5133vboxsync#define __GLX_PUT_SHORT() \
68fb2428898c55a7172e6a75a0a8d7ce259919bdvboxsync *(GLshort *)&__glXReply.pad3 = *(GLshort *)answer
f5f42fa2ec9924006cad8e5adc646b34b35ba3c3vboxsync
f5f42fa2ec9924006cad8e5adc646b34b35ba3c3vboxsync#define __GLX_PUT_INT() \
956a0e3c076406b83d635174a201fd8761ee5133vboxsync *(GLint *)&__glXReply.pad3 = *(GLint *)answer
956a0e3c076406b83d635174a201fd8761ee5133vboxsync
956a0e3c076406b83d635174a201fd8761ee5133vboxsync#define __GLX_PUT_FLOAT() \
956a0e3c076406b83d635174a201fd8761ee5133vboxsync *(GLfloat *)&__glXReply.pad3 = *(GLfloat *)answer
68fb2428898c55a7172e6a75a0a8d7ce259919bdvboxsync
68fb2428898c55a7172e6a75a0a8d7ce259919bdvboxsync#define __GLX_PUT_DOUBLE() \
956a0e3c076406b83d635174a201fd8761ee5133vboxsync *(GLdouble *)&__glXReply.pad3 = *(GLdouble *)answer
956a0e3c076406b83d635174a201fd8761ee5133vboxsync
956a0e3c076406b83d635174a201fd8761ee5133vboxsync#define __GLX_SEND_BYTE_ARRAY(len) \
956a0e3c076406b83d635174a201fd8761ee5133vboxsync WriteToClient(client, __GLX_PAD((len)*__GLX_SIZE_INT8), answer)
956a0e3c076406b83d635174a201fd8761ee5133vboxsync
956a0e3c076406b83d635174a201fd8761ee5133vboxsync#define __GLX_SEND_SHORT_ARRAY(len) \
956a0e3c076406b83d635174a201fd8761ee5133vboxsync WriteToClient(client, __GLX_PAD((len)*__GLX_SIZE_INT16), answer)
956a0e3c076406b83d635174a201fd8761ee5133vboxsync
956a0e3c076406b83d635174a201fd8761ee5133vboxsync#define __GLX_SEND_INT_ARRAY(len) \
956a0e3c076406b83d635174a201fd8761ee5133vboxsync WriteToClient(client, (len)*__GLX_SIZE_INT32, answer)
956a0e3c076406b83d635174a201fd8761ee5133vboxsync
956a0e3c076406b83d635174a201fd8761ee5133vboxsync#define __GLX_SEND_FLOAT_ARRAY(len) \
956a0e3c076406b83d635174a201fd8761ee5133vboxsync WriteToClient(client, (len)*__GLX_SIZE_FLOAT32, answer)
956a0e3c076406b83d635174a201fd8761ee5133vboxsync
956a0e3c076406b83d635174a201fd8761ee5133vboxsync#define __GLX_SEND_DOUBLE_ARRAY(len) \
956a0e3c076406b83d635174a201fd8761ee5133vboxsync WriteToClient(client, (len)*__GLX_SIZE_FLOAT64, answer)
956a0e3c076406b83d635174a201fd8761ee5133vboxsync
956a0e3c076406b83d635174a201fd8761ee5133vboxsync#define __GLX_SEND_VOID_ARRAY(len) __GLX_SEND_BYTE_ARRAY(len)
956a0e3c076406b83d635174a201fd8761ee5133vboxsync#define __GLX_SEND_UBYTE_ARRAY(len) __GLX_SEND_BYTE_ARRAY(len)
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync#define __GLX_SEND_USHORT_ARRAY(len) __GLX_SEND_SHORT_ARRAY(len)
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync#define __GLX_SEND_UINT_ARRAY(len) __GLX_SEND_INT_ARRAY(len)
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync/*
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync** PERFORMANCE NOTE:
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync** Machine dependent optimizations abound here; these swapping macros can
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync** conceivably be replaced with routines that do the job faster.
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync*/
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync#define __GLX_DECLARE_SWAP_VARIABLES \
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync GLbyte sw
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync#define __GLX_DECLARE_SWAP_ARRAY_VARIABLES \
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync GLbyte *swapPC; \
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync GLbyte *swapEnd
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync
735f45920cc3022a47b74cec9cf6eb7ab00d64dbvboxsync#define __GLX_SWAP_INT(pc) \
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync sw = ((GLbyte *)(pc))[0]; \
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync ((GLbyte *)(pc))[0] = ((GLbyte *)(pc))[3]; \
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync ((GLbyte *)(pc))[3] = sw; \
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync sw = ((GLbyte *)(pc))[1]; \
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync ((GLbyte *)(pc))[1] = ((GLbyte *)(pc))[2]; \
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync ((GLbyte *)(pc))[2] = sw;
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync#define __GLX_SWAP_SHORT(pc) \
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync sw = ((GLbyte *)(pc))[0]; \
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync ((GLbyte *)(pc))[0] = ((GLbyte *)(pc))[1]; \
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync ((GLbyte *)(pc))[1] = sw;
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync#define __GLX_SWAP_DOUBLE(pc) \
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync sw = ((GLbyte *)(pc))[0]; \
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync ((GLbyte *)(pc))[0] = ((GLbyte *)(pc))[7]; \
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync ((GLbyte *)(pc))[7] = sw; \
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync sw = ((GLbyte *)(pc))[1]; \
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync ((GLbyte *)(pc))[1] = ((GLbyte *)(pc))[6]; \
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync ((GLbyte *)(pc))[6] = sw; \
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync sw = ((GLbyte *)(pc))[2]; \
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync ((GLbyte *)(pc))[2] = ((GLbyte *)(pc))[5]; \
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync ((GLbyte *)(pc))[5] = sw; \
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync sw = ((GLbyte *)(pc))[3]; \
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync ((GLbyte *)(pc))[3] = ((GLbyte *)(pc))[4]; \
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync ((GLbyte *)(pc))[4] = sw;
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync#define __GLX_SWAP_FLOAT(pc) \
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync sw = ((GLbyte *)(pc))[0]; \
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync ((GLbyte *)(pc))[0] = ((GLbyte *)(pc))[3]; \
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync ((GLbyte *)(pc))[3] = sw; \
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync sw = ((GLbyte *)(pc))[1]; \
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync ((GLbyte *)(pc))[1] = ((GLbyte *)(pc))[2]; \
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync ((GLbyte *)(pc))[2] = sw;
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync#define __GLX_SWAP_INT_ARRAY(pc, count) \
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync swapPC = ((GLbyte *)(pc)); \
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync swapEnd = ((GLbyte *)(pc)) + (count)*__GLX_SIZE_INT32;\
956a0e3c076406b83d635174a201fd8761ee5133vboxsync while (swapPC < swapEnd) { \
956a0e3c076406b83d635174a201fd8761ee5133vboxsync __GLX_SWAP_INT(swapPC); \
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync swapPC += __GLX_SIZE_INT32; \
956a0e3c076406b83d635174a201fd8761ee5133vboxsync }
956a0e3c076406b83d635174a201fd8761ee5133vboxsync
956a0e3c076406b83d635174a201fd8761ee5133vboxsync#define __GLX_SWAP_SHORT_ARRAY(pc, count) \
956a0e3c076406b83d635174a201fd8761ee5133vboxsync swapPC = ((GLbyte *)(pc)); \
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync swapEnd = ((GLbyte *)(pc)) + (count)*__GLX_SIZE_INT16;\
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync while (swapPC < swapEnd) { \
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync __GLX_SWAP_SHORT(swapPC); \
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync swapPC += __GLX_SIZE_INT16; \
956a0e3c076406b83d635174a201fd8761ee5133vboxsync }
735f45920cc3022a47b74cec9cf6eb7ab00d64dbvboxsync
956a0e3c076406b83d635174a201fd8761ee5133vboxsync#define __GLX_SWAP_DOUBLE_ARRAY(pc, count) \
956a0e3c076406b83d635174a201fd8761ee5133vboxsync swapPC = ((GLbyte *)(pc)); \
956a0e3c076406b83d635174a201fd8761ee5133vboxsync swapEnd = ((GLbyte *)(pc)) + (count)*__GLX_SIZE_FLOAT64;\
956a0e3c076406b83d635174a201fd8761ee5133vboxsync while (swapPC < swapEnd) { \
956a0e3c076406b83d635174a201fd8761ee5133vboxsync __GLX_SWAP_DOUBLE(swapPC); \
956a0e3c076406b83d635174a201fd8761ee5133vboxsync swapPC += __GLX_SIZE_FLOAT64; \
956a0e3c076406b83d635174a201fd8761ee5133vboxsync }
956a0e3c076406b83d635174a201fd8761ee5133vboxsync
956a0e3c076406b83d635174a201fd8761ee5133vboxsync#define __GLX_SWAP_FLOAT_ARRAY(pc, count) \
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync swapPC = ((GLbyte *)(pc)); \
956a0e3c076406b83d635174a201fd8761ee5133vboxsync swapEnd = ((GLbyte *)(pc)) + (count)*__GLX_SIZE_FLOAT32;\
2a0a20dee7f474c26cc8f6f9d7aa12c345c2b73bvboxsync while (swapPC < swapEnd) { \
956a0e3c076406b83d635174a201fd8761ee5133vboxsync __GLX_SWAP_FLOAT(swapPC); \
956a0e3c076406b83d635174a201fd8761ee5133vboxsync swapPC += __GLX_SIZE_FLOAT32; \
956a0e3c076406b83d635174a201fd8761ee5133vboxsync }
956a0e3c076406b83d635174a201fd8761ee5133vboxsync
956a0e3c076406b83d635174a201fd8761ee5133vboxsync#define __GLX_SWAP_REPLY_HEADER() \
956a0e3c076406b83d635174a201fd8761ee5133vboxsync __GLX_SWAP_SHORT(&__glXReply.sequenceNumber); \
956a0e3c076406b83d635174a201fd8761ee5133vboxsync __GLX_SWAP_INT(&__glXReply.length);
956a0e3c076406b83d635174a201fd8761ee5133vboxsync
956a0e3c076406b83d635174a201fd8761ee5133vboxsync#define __GLX_SWAP_REPLY_RETVAL() \
956a0e3c076406b83d635174a201fd8761ee5133vboxsync __GLX_SWAP_INT(&__glXReply.retval)
956a0e3c076406b83d635174a201fd8761ee5133vboxsync
956a0e3c076406b83d635174a201fd8761ee5133vboxsync#define __GLX_SWAP_REPLY_SIZE() \
956a0e3c076406b83d635174a201fd8761ee5133vboxsync __GLX_SWAP_INT(&__glXReply.size)
956a0e3c076406b83d635174a201fd8761ee5133vboxsync
956a0e3c076406b83d635174a201fd8761ee5133vboxsync#endif /* !__GLX_unpack_h__ */
956a0e3c076406b83d635174a201fd8761ee5133vboxsync