#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#ifndef __GLX_unpack_h__
#define __GLX_unpack_h__
/*
* SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
* Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice including the dates of first publication and
* either this permission notice or a reference to
* shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* Except as contained in this notice, the name of Silicon Graphics, Inc.
* shall not be used in advertising or otherwise to promote the sale, use or
* other dealings in this Software without prior written authorization from
* Silicon Graphics, Inc.
*/
/*
** Fetch the context-id out of a SingleReq request pointed to by pc.
*/
/*
** Fetch a double from potentially unaligned memory.
*/
#ifdef __GLX_ALIGN64
#else
#endif
extern void __glXMemInit(void);
extern xGLXSingleReply __glXReply;
#define __GLX_SEND_HEADER() \
#define __GLX_PUT_RETVAL(a) \
__glXReply.retval = (a);
#define __GLX_PUT_SIZE(a) \
__glXReply.size = (a);
#define __GLX_PUT_RENDERMODE(m) \
__glXReply.pad3 = (m)
/*
** Get a buffer to hold returned data, with the given alignment. If we have
** to realloc, allocate size+align, in case the pointer has to be bumped for
** alignment. The answerBuffer should already be aligned.
**
** NOTE: the cast (long)res below assumes a long is large enough to hold a
** pointer.
*/
if ((size) > sizeof(answerBuffer)) { \
int bump; \
return BadAlloc; \
} \
} \
} else { \
res = (char *)answerBuffer; \
}
#define __GLX_PUT_BYTE() \
#define __GLX_PUT_SHORT() \
#define __GLX_PUT_INT() \
#define __GLX_PUT_FLOAT() \
#define __GLX_PUT_DOUBLE() \
/*
** PERFORMANCE NOTE:
** Machine dependent optimizations abound here; these swapping macros can
** conceivably be replaced with routines that do the job faster.
*/
#define __GLX_DECLARE_SWAP_VARIABLES \
#define __GLX_DECLARE_SWAP_ARRAY_VARIABLES \
__GLX_SWAP_INT(swapPC); \
swapPC += __GLX_SIZE_INT32; \
}
swapPC += __GLX_SIZE_INT16; \
}
swapPC += __GLX_SIZE_FLOAT64; \
}
swapPC += __GLX_SIZE_FLOAT32; \
}
#define __GLX_SWAP_REPLY_HEADER() \
#define __GLX_SWAP_REPLY_RETVAL() \
#define __GLX_SWAP_REPLY_SIZE() \
#endif /* !__GLX_unpack_h__ */