5 * Copyright 1997 Metro Link Incorporated
9 * Permission to use, copy, modify, distribute, and sell this software and its
10 * documentation for any purpose is hereby granted without fee, provided that
11 * the above copyright notice appear in all copies and that both that
12 * copyright notice and this permission notice appear in supporting
13 * documentation, and that the names of the above listed copyright holder(s)
14 * not be used in advertising or publicity pertaining to distribution of
15 * the software without specific, written prior permission. The above listed
16 * copyright holder(s) make(s) no representations about the suitability of
17 * this software for any purpose. It is provided "as is" without express or
20 * THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM(S) ALL WARRANTIES WITH REGARD
21 * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
22 * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
23 * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
24 * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
25 * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
26 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
28 /* $XFree86: xc/include/Xarch.h,v 1.10tsi Exp $ */
32 * Determine the machine's byte order.
35 /* See if it is set in the imake config first */
38 #define X_BIG_ENDIAN 4321
39 #define X_LITTLE_ENDIAN 1234
44 #if defined(NCR) || defined(Mips) || defined(__sgi)
45 #include <sys/endian.h>
48 #include <sys/byteorder.h>
51 #elif defined(CSRG_BASED)
52 #if defined(__NetBSD__) || defined(__OpenBSD__)
53 #include <sys/types.h>
55 #include <machine/endian.h>
57 #if defined __STRICT_ANSI__
58 #undef __STRICT_ANSI__
60 #define __STRICT_ANSI__
64 /* 'endian.h' might have been included before 'Xarch.h' */
65 #if !defined(LITTLE_ENDIAN) && defined(__LITTLE_ENDIAN)
66 #define LITTLE_ENDIAN __LITTLE_ENDIAN
68 #if !defined(BIG_ENDIAN) && defined(__BIG_ENDIAN)
69 #define BIG_ENDIAN __BIG_ENDIAN
71 #if !defined(PDP_ENDIAN) && defined(__PDP_ENDIAN)
72 #define PDP_ENDIAN __PDP_ENDIAN
74 #if !defined(BYTE_ORDER) && defined(__BYTE_ORDER)
75 #define BYTE_ORDER __BYTE_ORDER
79 /* LynxOS 2.4.0 has wrong defines in bsd/ip.h */
81 #include <bsd/in_systm.h>
87 #define LITTLE_ENDIAN 1234
88 #define BIG_ENDIAN 4321
90 #if defined(__QNX__) && !defined(__QNXNTO__)
91 #define BYTE_ORDER LITTLE_ENDIAN
94 #if defined(__QNXNTO__)
95 #if defined(i386) || defined(__i386__) || defined(__x86__)
96 #define BYTE_ORDER LITTLE_ENDIAN
98 #define BYTE_ORDER BIG_ENDIAN
103 #if defined(i386) || defined(__i386__) || defined(__x86__)
104 #define BYTE_ORDER LITTLE_ENDIAN
106 #define BYTE_ORDER BIG_ENDIAN
109 #if (defined(sun) && defined(SVR4)) && !defined(Lynx)
110 #include <sys/isa_defs.h>
111 #ifdef _LITTLE_ENDIAN
112 #define BYTE_ORDER LITTLE_ENDIAN
115 #define BYTE_ORDER BIG_ENDIAN
118 #endif /* BYTE_ORDER */
120 #define X_BYTE_ORDER BYTE_ORDER
121 #define X_BIG_ENDIAN BIG_ENDIAN
122 #define X_LITTLE_ENDIAN LITTLE_ENDIAN
124 #endif /* not in imake config */
126 #endif /* _XARCH_H_ */