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 00022 #ifndef __CS_CSSYSDEFS_H__ 00023 #error "cssysdef.h must be included in EVERY source file!" 00024 #endif 00025 00026 #include "platform.h" 00027 #include <float.h> 00028 00029 //----------------------------------------------------------------------------- 00030 // If your compiler complains about 'true', 'false', and 'bool' it may be an 00031 // older C++ compiler which doesn't understand these constructs. In that case, 00032 // set CS_USE_FAKE_BOOL_TYPE to 'yes' in the makefile, or define the C-macro 00033 // CS_USE_FAKE_BOOL_TYPE in your project file. 00034 //----------------------------------------------------------------------------- 00035 #ifdef CS_USE_FAKE_BOOL_TYPE 00036 typedef int bool; 00037 #undef true 00038 #define true 1 00039 #undef false 00040 #define false 0 00041 #endif 00042 00043 //----------------------------------------------------------------------------- 00044 // Make sure the following six types are correct for your system. 00045 //----------------------------------------------------------------------------- 00046 typedef unsigned char UByte; // Unsigned 8 bit value 00047 typedef signed char SByte; // Signed 8 bit value 00048 typedef unsigned short UShort; // Unsigned 16 bit value 00049 typedef signed short SShort; // Signed 16 bit value 00050 typedef unsigned long ULong; // Unsigned 32 bit value 00051 typedef signed long SLong; // Signed 32 bit value 00052 typedef unsigned int UInt; // Unsigned int value (16..32 bit) 00053 typedef signed int SInt; // Signed int value (16..32 bit) 00054 00055 typedef unsigned long CS_ID; // Used for uniquely generated id numbers 00056 00057 //----------------------------------------------------------------------------- 00058 // The following types should be used whenever you need a variable of 00059 // a specific size (in bits). If these types are already defined by system 00060 // headers for a particular platform, then define CS_BUILTIN_SIZED_TYPES to 00061 // avoid duplicate type definition here. 00062 //----------------------------------------------------------------------------- 00063 #if !defined(CS_BUILTIN_SIZED_TYPES) 00064 typedef unsigned char uint8; 00065 typedef char int8; 00066 typedef unsigned short uint16; 00067 typedef short int16; 00068 typedef unsigned int uint32; 00069 typedef int int32; 00070 #endif 00071 00072 //------------------------------ 00073 // Shortcuts for normal C types 00074 //------------------------------ 00075 typedef unsigned char uchar; 00076 typedef unsigned short ushort; 00077 typedef unsigned int uint; 00078 typedef unsigned long ulong; 00079 00080 // Time in milli (1/1000) seconds 00081 typedef unsigned int csTicks; 00082 00083 // A pointer to something 00084 typedef void *csSome; 00085 // A pointer to some constant 00086 typedef const void *csConstSome; 00087 00088 #endif // __CS_CSTYPES_H__