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 #ifndef __SYMBIAN32__
00115 #ifdef _DEBUG
00116 #define _CRTDBG_MAP_ALLOC
00117 #define _INC_MALLOC
00118 #include <crtdbg.h>
00119 #endif
00120 #endif
00121 #endif
00122
00123
00124 #if defined(_MSC_VER)
00125 #ifdef _DEBUG
00126 #undef new
00127 #define new MYDEBUG_NEW
00128 #endif
00129 #endif
00130
00131 #ifdef __SYMBIAN32__
00132
00133 #include <assert.h>
00134 #if defined(_UNICODE)
00135 #define UNICODE_STRINGS
00136 #endif
00137
00138 inline void ExitSystem()
00139 {
00140 User::Leave(KErrGeneral);
00141 }
00143 #define skNEW(a) new (ELeave) a
00144 #define skARRAY_NEW(type,size) new (ELeave) type[size]
00145
00146 #define SAVE_POINTER(p) CleanupDeletePushL((p))
00147 #define SAVE_VARIABLE(p) CleanupStack::PushL((p))
00148
00149 #define RELEASE_POINTER(p) CleanupStack::Pop(p)
00150
00151 #define RELEASE_VARIABLE(p) CleanupStack::Pop(&p)
00152 #else
00153
00154 #define skNEW(a) new a
00155 #define skARRAY_NEW(type,size) new type[size]
00156 #define SAVE_POINTER(p)
00157 #define RELEASE_POINTER(p)
00158 #define SAVE_VARIABLE(p)
00159 #define RELEASE_VARIABLE(p)
00160
00161 #ifdef _WIN32_WCE
00162 #include <windows.h>
00163 #include <dbgapi.h>
00164 #define assert ASSERT
00165 #define UNICODE_STRINGS
00166
00167 inline void ExitSystem()
00168 {
00169 exit(EXIT_FAILURE);
00170 }
00171 #else
00172 #define STREAMS_ENABLED
00173 #define EXCEPTIONS_DEFINED
00174 #include <assert.h>
00175 #endif
00176 #endif
00177 #endif