2 // Copyright (C) 2009 Mozilla Foundation
4 // Permission is hereby granted, free of charge, to any person obtaining
5 // a copy of this software and associated documentation files (the "Software"),
6 // to deal in the Software without restriction, including without limitation
7 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 // and/or sell copies of the Software, and to permit persons to whom the Software
9 // is furnished to do so, subject to the following conditions:
11 // The above copyright notice and this permission notice shall be included in
12 // all copies or substantial portions of the Software.
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
16 // THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 #if BYTE_ORDER == LITTLE_ENDIAN
26 #define IS_LITTLE_ENDIAN
27 #elif BYTE_ORDER == BIG_ENDIAN
31 /* all of the platforms that we use _MSC_VER on are little endian
32 * so this is sufficient for now */
34 #define IS_LITTLE_ENDIAN
38 #define IS_LITTLE_ENDIAN
41 #if !defined(IS_LITTLE_ENDIAN) && !defined(IS_BIG_ENDIAN)
42 #error Unknown endianess
45 #if defined (_SVR4) || defined (SVR4) || defined (__OpenBSD__) || defined (_sgi) || defined (__sun) || defined (sun) || defined (__digital__)
46 # include <inttypes.h>
47 #elif defined (_MSC_VER) && _MSC_VER < 1600
48 typedef __int8
int8_t;
49 typedef unsigned __int8
uint8_t;
50 typedef __int16
int16_t;
51 typedef unsigned __int16
uint16_t;
52 typedef __int32
int32_t;
53 typedef unsigned __int32
uint32_t;
54 typedef __int64
int64_t;
55 typedef unsigned __int64
uint64_t;
57 typedef unsigned __int64
uintptr_t;
60 /* Disable benign redefinition of type warning 4142 */
61 #pragma warning(disable:4142)
62 typedef unsigned long uintptr_t;
63 /* Restore warnings */
68 # include <sys/inttypes.h>
73 typedef qcms_bool
bool;