src/common.h

changeset 513
29eb671b34f6
parent 498
791c831c8020
child 515
a0ad72800b96
equal deleted inserted replaced
512:adab82ab13a5 513:29eb671b34f6
23 #ifndef LDFORGE_COMMON_H 23 #ifndef LDFORGE_COMMON_H
24 #define LDFORGE_COMMON_H 24 #define LDFORGE_COMMON_H
25 25
26 #include <stdio.h> 26 #include <stdio.h>
27 #include <stdlib.h> 27 #include <stdlib.h>
28 #include <assert.h>
29 #include <stdint.h> 28 #include <stdint.h>
30 #include <stdarg.h> 29 #include <stdarg.h>
31 #include <QString> 30 #include <QString>
32 #include <QMutex> 31 #include <QMutex>
33 32
72 # define DIRSLASH_CHAR '\\' 71 # define DIRSLASH_CHAR '\\'
73 #else // WIN32 72 #else // WIN32
74 # define DIRSLASH "/" 73 # define DIRSLASH "/"
75 # define DIRSLASH_CHAR '/' 74 # define DIRSLASH_CHAR '/'
76 #endif // WIN32 75 #endif // WIN32
77
78 #ifdef RELEASE
79 # define NDEBUG // remove asserts
80 #endif // RELEASE
81 76
82 #define PROP_NAME(GET) m_##GET 77 #define PROP_NAME(GET) m_##GET
83 78
84 #define READ_ACCESSOR(T, GET) \ 79 #define READ_ACCESSOR(T, GET) \
85 T const& GET() const 80 T const& GET() const
142 #define FUNCNAME __func__ 137 #define FUNCNAME __func__
143 #endif // __GNUC__ 138 #endif // __GNUC__
144 139
145 // Replace assert with a version that shows a GUI dialog if possible. 140 // 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. 141 // On Windows I just can't get the actual error messages otherwise.
142 void assertionFailure (const char* file, int line, const char* funcname, const char* expr);
143
147 #ifdef assert 144 #ifdef assert
148 #undef assert 145 # undef assert
149 #endif // assert 146 #endif // assert
150 147
151 void assertionFailure (const char* file, int line, const char* funcname, const char* expr); 148 #ifdef DEBUG
152 #define assert(N) ((N) ? (void) 0 : assertionFailure (__FILE__, __LINE__, FUNCNAME, #N)) 149 # define assert(N) ((N) ? (void) 0 : assertionFailure (__FILE__, __LINE__, FUNCNAME, #N))
150 #else
151 # define assert(N)
152 #endif // DEBUG
153 153
154 // Version string identifier 154 // Version string identifier
155 QString versionString(); 155 QString versionString();
156 QString versionMoniker(); 156 QString versionMoniker();
157 QString fullVersionString(); 157 QString fullVersionString();

mercurial