VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/xorg-server-1.9.0/glxbyteorder.h@ 62425

最後變更 在這個檔案從62425是 32163,由 vboxsync 提交於 14 年 前

Additions/x11/x11include: additional headers for building drivers for X.Org Server 1.9

  • 屬性 svn:eol-style 設為 native
檔案大小: 2.1 KB
 
1/*
2 * (C) Copyright IBM Corporation 2006, 2007
3 * All Rights Reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sub license,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice (including the next
13 * paragraph) shall be included in all copies or substantial portions of the
14 * Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
19 * THE COPYRIGHT HOLDERS, THE AUTHORS, AND/OR THEIR SUPPLIERS BE LIABLE FOR
20 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
22 * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 */
24
25/**
26 * \file glxbyteorder.h
27 * Platform glue for handling byte-ordering issues in GLX protocol.
28 *
29 * \author Ian Romanick <[email protected]>
30 */
31#if !defined(__GLXBYTEORDER_H__)
32#define __GLXBYTEORDER_H__
33
34#ifdef HAVE_DIX_CONFIG_H
35#include <dix-config.h>
36#endif
37
38#if HAVE_BYTESWAP_H
39#include <byteswap.h>
40#elif defined(USE_SYS_ENDIAN_H)
41#include <sys/endian.h>
42#elif defined(__APPLE__)
43#include <libkern/OSByteOrder.h>
44#define bswap_16 OSSwapInt16
45#define bswap_32 OSSwapInt32
46#define bswap_64 OSSwapInt64
47#else
48#define bswap_16(value) \
49 ((((value) & 0xff) << 8) | ((value) >> 8))
50
51#define bswap_32(value) \
52 (((uint32_t)bswap_16((uint16_t)((value) & 0xffff)) << 16) | \
53 (uint32_t)bswap_16((uint16_t)((value) >> 16)))
54
55#define bswap_64(value) \
56 (((uint64_t)bswap_32((uint32_t)((value) & 0xffffffff)) \
57 << 32) | \
58 (uint64_t)bswap_32((uint32_t)((value) >> 32)))
59#endif
60
61#endif /* !defined(__GLXBYTEORDER_H__) */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette