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