Blender  V2.59
superlu_sys_types.h
Go to the documentation of this file.
00001 /*
00002  * $Id: superlu_sys_types.h 36360 2011-04-28 05:15:47Z campbellbarton $
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  * A platform-independent definition of [u]intXX_t
00029  * Plus the accompanying header include for htonl/ntohl
00030  *
00031  * This file includes <sys/types.h> to define [u]intXX_t types, where
00032  * XX can be 8, 16, 32 or 64. Unfortunately, not all systems have this
00033  * file.
00034  * - Windows uses __intXX compiler-builtin types. These are signed,
00035  *   so we have to flip the signs.
00036  * For these rogue platforms, we make the typedefs ourselves.
00037  *
00038  */
00039 
00045 /* 
00046 // DG: original BLO_sys_types.h is in source/blender/blenkernel 
00047 // but is not allowed be accessed here because of bad-level-call
00048 // jesterKing: renamed to superlu_sys_types.h
00049 */
00050 
00051 #ifndef SUPERLU_SYS_TYPES_H
00052 #define SUPERLU_SYS_TYPES_H
00053 
00054 #ifdef __cplusplus
00055 extern "C" {
00056 #endif
00057  
00058 #if defined(_WIN32) && !defined(FREE_WINDOWS)
00059 
00060 /* The __intXX are built-in types of the visual complier! So we don't
00061  * need to include anything else here. */
00062 
00063 
00064 typedef signed __int8  int8_t;
00065 typedef signed __int16 int16_t;
00066 typedef signed __int32 int32_t;
00067 typedef signed __int64 int64_t;
00068 
00069 typedef unsigned __int8  uint8_t;
00070 typedef unsigned __int16 uint16_t;
00071 typedef unsigned __int32 uint32_t;
00072 typedef unsigned __int64 uint64_t;
00073 
00074 #ifndef _INTPTR_T_DEFINED
00075 #ifdef _WIN64
00076 typedef __int64 intptr_t;
00077 #else
00078 typedef long intptr_t;
00079 #endif
00080 #define _INTPTR_T_DEFINED
00081 #endif
00082 
00083 #ifndef _UINTPTR_T_DEFINED
00084 #ifdef _WIN64
00085 typedef unsigned __int64 uintptr_t;
00086 #else
00087 typedef unsigned long uintptr_t;
00088 #endif
00089 #define _UINTPTR_T_DEFINED
00090 #endif
00091 
00092 #elif defined(__linux__) || defined(__NetBSD__)
00093 
00094         /* Linux-i386, Linux-Alpha, Linux-ppc */
00095 #include <stdint.h>
00096 
00097 #elif defined (__APPLE__)
00098 
00099 #include <inttypes.h>
00100 
00101 #elif defined(FREE_WINDOWS)
00102 
00103 #include <stdint.h>
00104 
00105 #else
00106 
00107         /* FreeBSD, Irix, Solaris */
00108 #include <sys/types.h>
00109 
00110 #endif /* ifdef platform for types */
00111 
00112 
00113 #ifdef _WIN32
00114 #ifndef htonl
00115 #define htonl(x) correctByteOrder(x)
00116 #endif
00117 #ifndef ntohl
00118 #define ntohl(x) correctByteOrder(x)
00119 #endif
00120 #elif defined (__FreeBSD__) || defined (__OpenBSD__) 
00121 #include <sys/param.h>
00122 #elif defined (__APPLE__)
00123 #include <sys/types.h>
00124 #else  /* irix sun linux */
00125 #include <netinet/in.h>
00126 #endif /* ifdef platform for htonl/ntohl */
00127 
00128 #ifdef __cplusplus 
00129 }
00130 #endif
00131 
00132 #endif /* SUPERLU_SYS_TYPES_H */
00133