00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef COMMON_TYPES_H
00020 #define COMMON_TYPES_H
00021
00022 #ifdef HAVE_CONFIG_H
00023 # include <config.h>
00024 #endif
00025
00026 #include <string>
00027
00028 #ifdef BEOS
00029
00030 #include <be/support/SupportDefs.h>
00031 typedef int8 sint8;
00032 typedef int16 sint16;
00033 typedef int32 sint32;
00034
00035 #else
00036
00037 #ifndef EX_TYPE_INT8
00038 # define EX_TYPE_INT8 char
00039 #endif
00040
00041 #ifndef EX_TYPE_INT16
00042 # if (SIZEOF_SHORT == 2)
00043 # define EX_TYPE_INT16 short
00044 # elif (SIZEOF_INT == 2)
00045 # define EX_TYPE_INT16 int
00046 # else
00047 # error "Please make sure a 16 bit type is provided by exult_types.h"
00048 # endif
00049 #endif
00050
00051
00052 #ifndef EX_TYPE_INT32
00053 # if (SIZEOF_INT == 4)
00054 # define EX_TYPE_INT32 int
00055 # elif (SIZEOF_LONG == 4)
00056 # define EX_TYPE_INT32 long
00057 # elif (SIZEOF_LONG_LONG == 4)
00058 # define EX_TYPE_INT32 long long
00059 # else
00060 # error "Please make sure a 32 bit type is provided by exult_types.h"
00061 # endif
00062 #endif
00063
00064
00065 typedef unsigned EX_TYPE_INT8 uint8;
00066 typedef unsigned EX_TYPE_INT16 uint16;
00067 typedef unsigned EX_TYPE_INT32 uint32;
00068
00069 typedef signed EX_TYPE_INT8 sint8;
00070 typedef signed EX_TYPE_INT16 sint16;
00071 typedef signed EX_TYPE_INT32 sint32;
00072
00073
00074 #endif //BeOS
00075
00076
00077
00078
00079 extern const std::string c_empty_string;
00080
00081
00082
00083 #ifdef DEBUG
00084 # define COUT(x) do { std::cout << x << std::endl; std::cout.flush(); } while (0)
00085 # define CERR(x) do { std::cerr << x << std::endl; std::cerr.flush(); } while (0)
00086 #else
00087 # define COUT(x) do { } while(0)
00088 # define CERR(x) do { } while(0)
00089 #endif
00090
00091
00092
00093
00094 #define FORGET_OBJECT(x) do { delete x; x = 0; } while(0)
00095 #define FORGET_ARRAY(x) do { delete [] x; x = 0; } while(0)
00096
00097
00098 #endif
00099