00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef skGENERAL_H
00022 #define skGENERAL_H
00023
00024 #if defined(_MSC_VER)
00025 #if (_MSC_VER<=1300)
00026 #define USE_DEBUG_NEW
00027 #endif
00028 #endif
00029
00030 #ifndef __SYMBIAN32__
00031 #if defined(USE_DEBUG_NEW)
00032 #ifdef _DEBUG
00033 #define MYDEBUG_NEW new( _NORMAL_BLOCK, __FILE__, __LINE__)
00034
00035
00036 #else
00037 #define MYDEBUG_NEW
00038 #endif // _DEBUG
00039 #endif
00040 #endif
00041
00042
00043 #ifdef __SYMBIAN32__
00044 #include <E32BASE.H>
00045 #include <stdlib.h>
00046 #include <string.h>
00047 #include <stdio.h>
00048 #include "skSymbian.h"
00049 #include <eikenv.h>
00050 #else
00051 #include <stdlib.h>
00052 #endif
00053
00054 typedef unsigned int USize;
00055
00056 #ifndef max
00057 #define max(a,b) (((a)>(b))?(a):(b))
00058 #endif
00059 #ifndef min
00060 #define min(a,b) (((a)<(b))?(a):(b))
00061 #endif
00062
00063
00064
00065
00066
00067
00068
00069 #ifdef ENABLE_WINDOWS_THREAD_SUPPORT
00070 #if defined(_MSC_VER) && (_MSC_VER >= 1200 )
00071 #define THREAD __declspec(thread)
00072 #else
00073 #define THREAD
00074 #endif
00075 #else
00076 #define THREAD
00077 #endif
00078
00079
00080
00081
00082 #ifdef ENABLE_WINDOWS_DLL_SUPPORT
00083 #if defined(_MSC_VER)
00084 #define LIBIMPORT __declspec( dllimport )
00085 #define LIBEXPORT __declspec( dllexport )
00086 #endif
00087 #if defined(BUILDING_DLL)
00088 #define CLASSEXPORT LIBEXPORT
00089 #define EXTERN_TEMPLATE
00090 #else
00091 #define CLASSEXPORT LIBIMPORT
00092 #define EXTERN_TEMPLATE extern
00093 #endif
00094 #else
00095 #ifdef __SYMBIAN32__
00096 #define CLASSEXPORT
00097 #else
00098
00099 #define LIBIMPORT
00100 #define LIBEXPORT
00101 #define CLASSEXPORT
00102 #define EXTERN_TEMPLATE
00103 #endif
00104 #endif
00105
00106 #ifndef __SYMBIAN32__
00107
00108 #define INSTANTIATE_TEMPLATES
00109 #define IMPORT_C
00110 #define EXPORT_C
00111 #endif
00112
00113
00114 #define USE_FLOATING_POINT 1
00115
00116
00117 #define EXECUTE_PARSENODES 1
00118
00119
00120 #if defined(USE_DEBUG_NEW)
00121 #ifndef __SYMBIAN32__
00122 #ifdef _DEBUG
00123 #define _CRTDBG_MAP_ALLOC
00124 #define _INC_MALLOC
00125 #include <crtdbg.h>
00126 #endif
00127 #endif
00128 #endif
00129
00130
00131 #ifndef __SYMBIAN32__
00132 #if defined(USE_DEBUG_NEW)
00133 #ifdef _DEBUG
00134 #undef new
00135 #define new MYDEBUG_NEW
00136 #endif
00137 #endif
00138 #endif
00139
00140 #ifdef __SYMBIAN32__
00141
00142 #include <assert.h>
00143 #if defined(_UNICODE)
00144 #define UNICODE_STRINGS
00145 #endif
00146
00147 inline void ExitSystem()
00148 {
00149 User::Leave(KErrGeneral);
00150 }
00152 #define skNEW(a) new (ELeave) a
00153 #define skARRAY_NEW(type,size) new (ELeave) type[size]
00154
00155 #define SAVE_POINTER(p) CleanupDeletePushL((p))
00156 #define SAVE_VARIABLE(p) CleanupStack::PushL((p))
00157
00158 #define RELEASE_POINTER(p) CleanupStack::Pop(p)
00159
00160 #define RELEASE_VARIABLE(p) CleanupStack::Pop(&p)
00161 #else
00162
00163 #define skNEW(a) new a
00164 #define skARRAY_NEW(type,size) new type[size]
00165 #define SAVE_POINTER(p)
00166 #define RELEASE_POINTER(p)
00167 #define SAVE_VARIABLE(p)
00168 #define RELEASE_VARIABLE(p)
00169
00170 #ifdef _WIN32_WCE
00171 #include <windows.h>
00172 #include <dbgapi.h>
00173 #define assert ASSERT
00174 #define UNICODE_STRINGS
00175
00176 inline void ExitSystem()
00177 {
00178 exit(EXIT_FAILURE);
00179 }
00180 #else
00181 #define STREAMS_ENABLED
00182 #if (_MSC_VER>1300)
00183 #define STL_STREAMS 1
00184 #endif
00185 #define EXCEPTIONS_DEFINED
00186 #include <assert.h>
00187 #endif
00188 #endif
00189 #endif