cstypes.h
Go to the documentation of this file.00001 /* 00002 Copyright (C) 1998 by Jorrit Tyberghein 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License as published by the Free Software Foundation; either 00007 version 2 of the License, or (at your option) any later version. 00008 00009 This library 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 GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public 00015 License along with this library; if not, write to the Free 00016 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00017 */ 00018 00019 #ifndef __CS_CSTYPES_H__ 00020 #define __CS_CSTYPES_H__ 00021 00027 #ifndef __CS_CSSYSDEFS_H__ 00028 #error "cssysdef.h must be included in EVERY source file!" 00029 #endif 00030 00031 #include "platform.h" 00032 #include <float.h> 00033 00034 //----------------------------------------------------------------------------- 00035 // If your compiler complains about 'true', 'false', and 'bool' it may be an 00036 // older C++ compiler which doesn't understand these constructs. In that case, 00037 // set CS_USE_FAKE_BOOL_TYPE to 'yes' in the makefile, or define the C-macro 00038 // CS_USE_FAKE_BOOL_TYPE in your project file. 00039 //----------------------------------------------------------------------------- 00040 #ifdef CS_USE_FAKE_BOOL_TYPE 00041 typedef int bool; 00042 #undef true 00043 #define true 1 00044 #undef false 00045 #define false 0 00046 #endif 00047 00054 #if !defined(CS_BUILTIN_SIZED_TYPES) 00055 00056 00057 #ifndef CS_HAS_STDINT_H 00058 00059 typedef unsigned char uint8; 00061 typedef char int8; 00063 typedef unsigned short uint16; 00065 typedef short int16; 00067 typedef unsigned int uint32; 00069 typedef int int32; 00070 #ifdef COMP_GCC 00071 00072 typedef unsigned long long uint64; 00074 typedef long long int64; 00076 #define CONST_INT64(x) x ## LL 00077 00078 #define CONST_UINT64(x) x ## ULL 00079 #else 00080 # if defined(COMP_VC) || defined(COMP_BC) || defined(__BORLANDC__) 00081 00082 typedef unsigned __int64 uint64; 00084 typedef __int64 int64; 00086 #define CONST_INT64(x) x##i64 00087 00088 #define CONST_UINT64(x) x##ui64 00089 # else 00090 # warning NO definition for 64 bit integers defined for your compiler 00091 # endif 00092 #endif // end of #ifdef COMP_GCC 00093 00094 #else 00095 // We're happy and can simply use stdint.h. 00096 #ifndef __STDC_CONSTANT_MACROS 00097 #define __STDC_CONSTANT_MACROS 00098 #endif 00099 #ifndef __STDC_LIMIT_MACROS 00100 #define __STDC_LIMIT_MACROS 00101 #endif 00102 #include <stdint.h> 00103 typedef uint8_t uint8; 00104 typedef int8_t int8; 00105 typedef uint16_t uint16; 00106 typedef int16_t int16; 00107 typedef uint32_t uint32; 00108 typedef int32_t int32; 00109 typedef uint64_t uint64; 00110 typedef int64_t int64; 00111 #define CONST_INT64(x) INT64_C(x) 00112 #define CONST_UINT64(x) UINT64_C(x) 00113 #endif 00114 00115 #endif // end of #if !defined(CS_BUILTIN_SIZED_TYPES) 00116 00118 00119 typedef uint32 CS_ID; 00120 00127 typedef unsigned int csTicks; 00128 00131 00132 typedef unsigned int uint; 00137 #endif // __CS_CSTYPES_H__
Generated for Crystal Space by doxygen 1.2.18