00001 #ifndef __platform_config_h__ 00002 #define __platform_config_h__ 00003 00004 // -------------------------------------------------- 00005 // language 00006 // -------------------------------------------------- 00007 00008 #if defined(__cplusplus) && defined(__SYMBIAN32__) 00009 #define __SYMBIAN_CXX__ 1 00010 #else 00011 #define __SYMBIAN_CXX__ 0 00012 #endif 00013 00014 /* Throwing and non-throwing "new" for C++. 00015 */ 00016 #if defined(__cplusplus) 00017 #if defined(__SYMBIAN32__) 00018 00019 // On Symbian, it seems that the (std::nothrow) is not supported, 00020 // although the <new> header is there. The semantics of Symbian's 00021 // default plain "new" are presently the same as for "new 00022 // (std::nothrow)", and hence this definition may suffice, with 00023 // default settings in the MMP file. 00024 #define new_nothrow new 00025 00026 // To implement this, we probably want to define a global, but 00027 // overloaded "new" operator of our own, one that does throw 00028 // std::badalloc. In standard C++ that is the default behavior. 00029 #define new_dothrow xxx 00030 00031 #else 00032 #include <new> 00033 #define new_nothrow new (std::nothrow) 00034 #define new_dothrow new 00035 #endif 00036 #endif 00037 00038 // -------------------------------------------------- 00039 // compiler 00040 // -------------------------------------------------- 00041 00042 #if defined(__GCCE__) 00043 #define __COMPILER_NAME__ "GCCE" 00044 #elif defined(__GNUC__) 00045 #define __COMPILER_NAME__ "GCC" 00046 #else 00047 #define __COMPILER_NAME__ "non-GCC" 00048 #endif 00049 00050 #if defined(__GNUC__) 00051 #define __GCC_VERSION__ (__GNUC__ * 10000 \ 00052 + __GNUC_MINOR__ * 100 \ 00053 + __GNUC_PATCHLEVEL__) 00054 #endif 00055 00056 // Be careful not to use an octal number here. 00057 #if (defined(__GCCE__) && (__GCC_VERSION__ <= 30403)) 00058 #define EXCEPTION_CRASHES_VARARGS_BUG 1 00059 #else 00060 #define EXCEPTION_CRASHES_VARARGS_BUG 0 00061 #endif 00062 00063 // -------------------------------------------------- 00064 // toolchain 00065 // -------------------------------------------------- 00066 00067 // Based on platform version we can compute a numerous 00068 // platform-specific definitions based on the version numbers. We can 00069 // also make use of the definitions in the __PRODUCT_INCLUDE__ should 00070 // that be useful. 00071 // 00072 // We can expect this component to be directly usable in a number of 00073 // projects, as we are not including any application specifics in this 00074 // header file. Keep those in "application_config.h". 00075 // 00076 // When checking for boolean style conditionals, you should favor #if 00077 // rather than #ifdef style checks to make it easier to notice if this 00078 // file is not #included where it should. 00079 00080 #ifdef __SYMBIAN32__ 00081 00082 // The __S60_VERNUM__ value being defined implies a configure system 00083 // that makes sconfig.hrh unnecessary. 00084 #if !defined(__S60_VERNUM__) 00085 #include "sconfig.hrh" 00086 #endif 00087 00088 #endif // __SYMBIAN32__ 00089 00090 // -------------------------------------------------- 00091 // platform 00092 // -------------------------------------------------- 00093 00094 #ifdef __SYMBIAN32__ 00095 #define DIR_SEP "\\" 00096 #else 00097 #define DIR_SEP "/" 00098 #endif 00099 00100 // This header is apparently included automatically by the toolchain, 00101 // provided that it holds that #if defined(__PRODUCT_INCLUDE__). 00102 #if 0 00103 #ifdef __SYMBIAN32__ 00104 #if defined(__SERIES60_30__) 00105 #include <symbian_os_v9.1.hrh> 00106 #elif defined(__SERIES60_31__) 00107 #include <symbian_os_v9.2.hrh> 00108 #elif defined(__SERIES60_32__) 00109 #include <symbian_os_v9.3.hrh> 00110 #elif defined(__SERIES60_50__) 00111 #include <symbian_os.hrh> 00112 #else 00113 #error unknown Symbian platform version 00114 #endif 00115 #endif 00116 #endif 00117 00118 // -------------------------------------------------- 00119 // libraries 00120 // -------------------------------------------------- 00121 00122 // It seems that the safer "n" variants of printf and g_printf are all 00123 // broken for floats in Open C. May be fixed in some versions of Open 00124 // C. Could compute this based on version number as well, if new of 00125 // any working version. Implementing a similar replacement in Symbian 00126 // C++ is definitely a possibility. 00127 // 00128 // Possibly the bug does not apply to all locales. 00129 // 00130 // The functions that we have deemed broken include: vsprintf, 00131 // vsnprintf. 00132 #define PRINTF_DOUBLE_BUGGY defined(__SYMBIAN32__) 00133 00134 #endif /* __platform_config_h__ */ 00135 00136 /** 00137 00138 platform_config.h 00139 00140 Copyright 2009 Helsinki Institute for Information Technology (HIIT) 00141 and the authors. All rights reserved. 00142 00143 Authors: Tero Hasu <tero.hasu@hut.fi> 00144 00145 Permission is hereby granted, free of charge, to any person 00146 obtaining a copy of this software and associated documentation files 00147 (the "Software"), to deal in the Software without restriction, 00148 including without limitation the rights to use, copy, modify, merge, 00149 publish, distribute, sublicense, and/or sell copies of the Software, 00150 and to permit persons to whom the Software is furnished to do so, 00151 subject to the following conditions: 00152 00153 The above copyright notice and this permission notice shall be 00154 included in all copies or substantial portions of the Software. 00155 00156 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 00157 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00158 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 00159 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 00160 BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 00161 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 00162 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 00163 SOFTWARE. 00164 00165 **/
ContextLogger2—ContextLogger2 Logger Daemon Internals—Generated on Mon May 2 13:49:55 2011 by Doxygen 1.6.1