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