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.
41 // DG: original BLO_sys_types.h is in source/blender/blenkernel
42 // but is not allowed be accessed here because of bad-level-call
45 #ifndef BLO_SYS_TYPES_H
46 #define BLO_SYS_TYPES_H
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;
67 #ifndef _INTPTR_T_DEFINED
69 typedef __int64 intptr_t;
71 typedef long intptr_t;
73 #define _INTPTR_T_DEFINED
76 #ifndef _UINTPTR_T_DEFINED
78 typedef unsigned __int64 uintptr_t;
80 typedef unsigned long uintptr_t;
82 #define _UINTPTR_T_DEFINED
85 #elif defined(__linux__)
87 /* Linux-i386, Linux-Alpha, Linux-ppc */
90 #elif defined (__APPLE__)
94 #elif defined(FREE_WINDOWS)
100 /* FreeBSD, Irix, Solaris */
101 #include <sys/types.h>
103 #endif /* ifdef platform for types */
107 #define htonl(x) correctByteOrder(x)
110 #define ntohl(x) correctByteOrder(x)
112 #elif defined (__FreeBSD__) || defined (__OpenBSD__)
113 #include <sys/param.h>
114 #elif defined (__APPLE__)
115 #include <sys/types.h>
116 #else /* irix sun linux */
117 #include <netinet/in.h>
118 #endif /* ifdef platform for htonl/ntohl */