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