4 * ***** BEGIN GPL/BL DUAL 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. The Blender
10 * Foundation also sells licenses for use in proprietary software under
11 * the Blender License. See http://www.blender.org/BL/ for information
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software Foundation,
21 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
24 * All rights reserved.
26 * The Original Code is: all of this file.
28 * Contributor(s): none yet.
30 * ***** END GPL/BL DUAL LICENSE BLOCK *****
31 * A platform-independent definition of [u]intXX_t
32 * Plus the accompanying header include for htonl/ntohl
34 * This file includes <sys/types.h> to define [u]intXX_t types, where
35 * XX can be 8, 16, 32 or 64. Unfortunately, not all systems have this
37 * - Windows uses __intXX compiler-builtin types. These are signed,
38 * so we have to flip the signs.
39 * For these rogue platforms, we make the typedefs ourselves.
43 #ifndef BLO_SYS_TYPES_H
44 #define BLO_SYS_TYPES_H
51 typedef unsigned char uint8_t;
52 typedef unsigned int uint32_t;
55 #if defined(_WIN32) && !defined(FREE_WINDOWS)
57 /* The __intXX are built-in types of the visual complier! So we don't
58 * need to include anything else here. */
60 typedef signed __int8 int8_t;
61 typedef signed __int16 int16_t;
62 typedef signed __int32 int32_t;
63 typedef signed __int64 int64_t;
65 typedef unsigned __int8 uint8_t;
66 typedef unsigned __int16 uint16_t;
67 typedef unsigned __int32 uint32_t;
68 typedef unsigned __int64 uint64_t;
70 #elif defined(__linux__)
72 /* Linux-i386, Linux-Alpha, Linux-ppc */
75 #elif defined (__APPLE__)
81 /* FreeBSD, Irix, Solaris */
82 #include <sys/types.h>
84 #endif /* ifdef platform for types */
87 #define htonl(x) correctByteOrder(x)
88 #define ntohl(x) correctByteOrder(x)
89 #elif defined (__FreeBSD__) || defined (__OpenBSD__)
90 #include <sys/param.h>
91 #elif defined (__APPLE__)
92 #include <sys/types.h>
93 #else /* irix sun linux */
94 #include <netinet/in.h>
95 #endif /* ifdef platform for htonl/ntohl */