Blender  V2.59
BLO_sys_types.h
Go to the documentation of this file.
00001 /*
00002  * $Id: BLO_sys_types.h 35245 2011-02-27 20:35:41Z jesterking $
00003  *
00004  * ***** BEGIN GPL LICENSE BLOCK *****
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software Foundation,
00018  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019  *
00020  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
00021  * All rights reserved.
00022  *
00023  * The Original Code is: all of this file.
00024  *
00025  * Contributor(s): none yet.
00026  *
00027  * ***** END GPL LICENSE BLOCK *****
00028  */
00029 
00045 #ifndef BLO_SYS_TYPES_H
00046 #define BLO_SYS_TYPES_H
00047 
00048 #ifdef __cplusplus
00049 extern "C" {
00050 #endif
00051  
00052 #if defined(_WIN32) && !defined(FREE_WINDOWS)
00053 
00054 /* The __intXX are built-in types of the visual complier! So we don't
00055  * need to include anything else here. */
00056 
00057 
00058 typedef signed __int8  int8_t;
00059 typedef signed __int16 int16_t;
00060 typedef signed __int32 int32_t;
00061 typedef signed __int64 int64_t;
00062 
00063 typedef unsigned __int8  uint8_t;
00064 typedef unsigned __int16 uint16_t;
00065 typedef unsigned __int32 uint32_t;
00066 typedef unsigned __int64 uint64_t;
00067 
00068 #ifndef _INTPTR_T_DEFINED
00069 #ifdef _WIN64
00070 typedef __int64 intptr_t;
00071 #else
00072 typedef long intptr_t;
00073 #endif
00074 #define _INTPTR_T_DEFINED
00075 #endif
00076 
00077 #ifndef _UINTPTR_T_DEFINED
00078 #ifdef _WIN64
00079 typedef unsigned __int64 uintptr_t;
00080 #else
00081 typedef unsigned long uintptr_t;
00082 #endif
00083 #define _UINTPTR_T_DEFINED
00084 #endif
00085 
00086 #elif defined(__linux__) || defined(__NetBSD__)
00087 
00088         /* Linux-i386, Linux-Alpha, Linux-ppc */
00089 #include <stdint.h>
00090 
00091 #elif defined (__APPLE__)
00092 
00093 #include <inttypes.h>
00094 
00095 #elif defined(FREE_WINDOWS)
00096 
00097 #include <stdint.h>
00098 
00099 #else
00100 
00101         /* FreeBSD, Irix, Solaris */
00102 #include <sys/types.h>
00103 
00104 #endif /* ifdef platform for types */
00105 
00106 
00107 #ifdef _WIN32
00108 #define htonl(x) correctByteOrder(x)
00109 #define ntohl(x) correctByteOrder(x)
00110 #elif defined (__FreeBSD__) || defined (__OpenBSD__) 
00111 #include <sys/param.h>
00112 #elif defined (__APPLE__)
00113 #include <sys/types.h>
00114 #else  /* irix sun linux */
00115 #include <netinet/in.h>
00116 #endif /* ifdef platform for htonl/ntohl */
00117 
00118 #ifdef __cplusplus 
00119 }
00120 #endif
00121 
00122 #endif /* eof */
00123