diff --git a/common/scummsys.h b/common/scummsys.h
index 4740127d2f..5486ba27c6 100644
a
|
b
|
|
154 | 154 | #endif |
155 | 155 | |
156 | 156 | #ifndef STATIC_ASSERT |
| 157 | #if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER > 1600) |
157 | 158 | /** |
158 | 159 | * Generates a compile-time assertion. |
159 | 160 | * |
… |
… |
|
162 | 163 | * time if the expression evaluates to false. |
163 | 164 | */ |
164 | 165 | #define STATIC_ASSERT(expression, message) \ |
165 | | extern int STATIC_ASSERT_##message[(expression) ? 1 : -1]; \ |
166 | | (void)(STATIC_ASSERT_##message); |
| 166 | static_assert((expression), #message) |
| 167 | #else |
| 168 | /** |
| 169 | * Generates a compile-time assertion. |
| 170 | * |
| 171 | * @param expression An expression that can be evaluated at compile time. |
| 172 | * @param message An underscore-delimited message to be presented at compile |
| 173 | * time if the expression evaluates to false. |
| 174 | */ |
| 175 | #define STATIC_ASSERT(expression, message) \ |
| 176 | do { \ |
| 177 | extern int STATIC_ASSERT_##message[(expression) ? 1 : -1]; \ |
| 178 | (void)(STATIC_ASSERT_##message); \ |
| 179 | } while (false) |
| 180 | #endif |
167 | 181 | #endif |
168 | 182 | |
169 | 183 | // The following math constants are usually defined by the system math.h header, but |