CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

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 # ifdef COMP_VC
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 #define __STDC_CONSTANT_MACROS
00097 #define __STDC_LIMIT_MACROS
00098 #include <stdint.h>
00099 typedef uint8_t uint8;
00100 typedef int8_t int8;
00101 typedef uint16_t uint16;
00102 typedef int16_t int16;
00103 typedef uint32_t uint32;
00104 typedef int32_t int32;
00105 typedef uint64_t uint64;
00106 typedef int64_t int64;
00107 #define CONST_INT64(x) INT64_C(x)
00108 #define CONST_UINT64(x) UINT64_C(x)
00109 #endif
00110 
00111 #endif // end of #if !defined(CS_BUILTIN_SIZED_TYPES)
00112 
00114 
00115 typedef uint32 CS_ID;
00116 
00118 typedef unsigned int csTicks;
00119 
00122 
00123 typedef unsigned int uint;
00128 #endif // __CS_CSTYPES_H__

Generated for Crystal Space by doxygen 1.2.14