| 66 # define FORMAT_PRINTF(M,N) |
66 # define FORMAT_PRINTF(M,N) |
| 67 # define ATTR(N) |
67 # define ATTR(N) |
| 68 #endif // __GNUC__ |
68 #endif // __GNUC__ |
| 69 |
69 |
| 70 #ifdef WIN32 |
70 #ifdef WIN32 |
| 71 #define DIRSLASH "\\" |
71 # define DIRSLASH "\\" |
| 72 #define DIRSLASH_CHAR '\\' |
72 # define DIRSLASH_CHAR '\\' |
| 73 #else // WIN32 |
73 #else // WIN32 |
| 74 #define DIRSLASH "/" |
74 # define DIRSLASH "/" |
| 75 #define DIRSLASH_CHAR '/' |
75 # define DIRSLASH_CHAR '/' |
| 76 #endif // WIN32 |
76 #endif // WIN32 |
| 77 |
77 |
| 78 #ifdef RELEASE |
78 #ifdef RELEASE |
| 79 #define NDEBUG // remove asserts |
79 # define NDEBUG // remove asserts |
| 80 #endif // RELEASE |
80 #endif // RELEASE |
| 81 |
81 |
| 82 #define PROP_NAME(GET) m_##GET |
82 #define PROP_NAME(GET) m_##GET |
| 83 |
83 |
| 84 #define READ_ACCESSOR(T, GET) \ |
84 #define READ_ACCESSOR(T, GET) \ |
| 140 #define FUNCNAME __PRETTY_FUNCTION__ |
140 #define FUNCNAME __PRETTY_FUNCTION__ |
| 141 #else |
141 #else |
| 142 #define FUNCNAME __func__ |
142 #define FUNCNAME __func__ |
| 143 #endif // __GNUC__ |
143 #endif // __GNUC__ |
| 144 |
144 |
| 145 // Replace assert with a version that shows a GUI dialog if possible |
145 // Replace assert with a version that shows a GUI dialog if possible. |
| |
146 // On Windows I just can't get the actual error messages otherwise. |
| 146 #ifdef assert |
147 #ifdef assert |
| 147 #undef assert |
148 #undef assert |
| 148 #endif // assert |
149 #endif // assert |
| 149 |
150 |
| 150 class QString; |
|
| 151 typedef QString str; |
|
| 152 |
|
| 153 void assertionFailure (const char* file, const ulong line, const char* funcname, const char* expr); |
151 void assertionFailure (const char* file, const ulong line, const char* funcname, const char* expr); |
| 154 void fatalError (const char* file, const ulong line, const char* funcname, str errmsg); |
152 #define assert(N) ((N) ? (void) 0 : assertionFailure (__FILE__, __LINE__, FUNCNAME, #N)) |
| 155 |
153 |
| 156 // Version string identifier |
154 // Version string identifier |
| 157 str versionString(); |
155 QString versionString(); |
| 158 str versionMoniker(); |
156 QString versionMoniker(); |
| 159 str fullVersionString(); |
157 QString fullVersionString(); |
| 160 |
|
| 161 #define assert(N) \ |
|
| 162 ((N) ? (void) 0 : assertionFailure (__FILE__, __LINE__, FUNCNAME, #N)) |
|
| 163 |
|
| 164 #define fatal(MSG) \ |
|
| 165 fatalError (__FILE__, __LINE__, FUNCNAME, MSG) |
|
| 166 |
158 |
| 167 // ----------------------------------------------------------------------------- |
159 // ----------------------------------------------------------------------------- |
| 168 #ifdef IN_IDE_PARSER // KDevelop workarounds: |
160 #ifdef IN_IDE_PARSER // KDevelop workarounds: |
| 169 # error IN_IDE_PARSER is defined (this code is only for KDevelop workarounds) |
161 # error IN_IDE_PARSER is defined (this code is only for KDevelop workarounds) |
| 170 |
162 |