OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
261 #define SEMI_STATIC_JOIN_HELPER(a, b) a##b | 261 #define SEMI_STATIC_JOIN_HELPER(a, b) a##b |
262 // Causes an error during compilation of the condition is not | 262 // Causes an error during compilation of the condition is not |
263 // statically known to be true. It is formulated as a typedef so that | 263 // statically known to be true. It is formulated as a typedef so that |
264 // it can be used wherever a typedef can be used. Beware that this | 264 // it can be used wherever a typedef can be used. Beware that this |
265 // actually causes each use to introduce a new defined type with a | 265 // actually causes each use to introduce a new defined type with a |
266 // name depending on the source line. | 266 // name depending on the source line. |
267 template <int> class StaticAssertionHelper { }; | 267 template <int> class StaticAssertionHelper { }; |
268 #define STATIC_CHECK(test) \ | 268 #define STATIC_CHECK(test) \ |
269 typedef \ | 269 typedef \ |
270 StaticAssertionHelper<sizeof(StaticAssertion<static_cast<bool>((test))>)> \ | 270 StaticAssertionHelper<sizeof(StaticAssertion<static_cast<bool>((test))>)> \ |
271 SEMI_STATIC_JOIN(__StaticAssertTypedef__, __LINE__) | 271 SEMI_STATIC_JOIN(__StaticAssertTypedef__, __LINE__) \ |
272 __attribute__((unused)) // Silence GCC-4.8's warnings. | |
Benedikt Meurer
2013/11/12 10:31:42
This will fail on Visual Studio. Please add an app
Jakob Kummerow
2013/11/12 12:01:29
Done.
| |
272 #endif | 273 #endif |
273 | 274 |
274 | 275 |
275 #ifdef DEBUG | 276 #ifdef DEBUG |
276 #ifndef OPTIMIZED_DEBUG | 277 #ifndef OPTIMIZED_DEBUG |
277 #define ENABLE_SLOW_ASSERTS 1 | 278 #define ENABLE_SLOW_ASSERTS 1 |
278 #endif | 279 #endif |
279 #endif | 280 #endif |
280 | 281 |
281 namespace v8 { | 282 namespace v8 { |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
322 | 323 |
323 // "Extra checks" are lightweight checks that are enabled in some release | 324 // "Extra checks" are lightweight checks that are enabled in some release |
324 // builds. | 325 // builds. |
325 #ifdef ENABLE_EXTRA_CHECKS | 326 #ifdef ENABLE_EXTRA_CHECKS |
326 #define EXTRA_CHECK(condition) CHECK(condition) | 327 #define EXTRA_CHECK(condition) CHECK(condition) |
327 #else | 328 #else |
328 #define EXTRA_CHECK(condition) ((void) 0) | 329 #define EXTRA_CHECK(condition) ((void) 0) |
329 #endif | 330 #endif |
330 | 331 |
331 #endif // V8_CHECKS_H_ | 332 #endif // V8_CHECKS_H_ |
OLD | NEW |