4 * ***** BEGIN GPL LICENSE BLOCK *****
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
21 * All rights reserved.
23 * The Original Code is: all of this file.
25 * Contributor(s): none yet.
27 * ***** END GPL LICENSE BLOCK *****
28 * A platform-independent definition of [u]intXX_t
29 * Plus the accompanying header include for htonl/ntohl
31 * This file includes <sys/types.h> to define [u]intXX_t types, where
32 * XX can be 8, 16, 32 or 64. Unfortunately, not all systems have this
34 * - Windows uses __intXX compiler-builtin types. These are signed,
35 * so we have to flip the signs.
36 * For these rogue platforms, we make the typedefs ourselves.
40 #ifndef BLO_SYS_TYPES_H
41 #define BLO_SYS_TYPES_H
48 typedef unsigned char uint8_t;
49 typedef unsigned int uint32_t;
52 #if defined(_WIN32) && !defined(FREE_WINDOWS)
54 /* The __intXX are built-in types of the visual complier! So we don't
55 * need to include anything else here. */
57 typedef signed __int8 int8_t;
58 typedef signed __int16 int16_t;
59 typedef signed __int32 int32_t;
60 typedef signed __int64 int64_t;
62 typedef unsigned __int8 uint8_t;
63 typedef unsigned __int16 uint16_t;
64 typedef unsigned __int32 uint32_t;
65 typedef unsigned __int64 uint64_t;
68 typedef __int64 intptr_t;
69 typedef unsigned __int64 uintptr_t;
71 typedef long intptr_t;
72 typedef unsigned long uintptr_t;
75 #elif defined(__linux__)
77 /* Linux-i386, Linux-Alpha, Linux-ppc */
80 #elif defined (__APPLE__)
86 /* FreeBSD, Irix, Solaris */
87 #include <sys/types.h>
89 #endif /* ifdef platform for types */
92 #define htonl(x) correctByteOrder(x)
93 #define ntohl(x) correctByteOrder(x)
94 #elif defined (__FreeBSD__) || defined (__OpenBSD__)
95 #include <sys/param.h>
96 #elif defined (__APPLE__)
97 #include <sys/types.h>
98 #else /* irix sun linux */
99 #include <netinet/in.h>
100 #endif /* ifdef platform for htonl/ntohl */