Blender V2.61 - r43446

BLO_sys_types.h

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