Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(450)

Side by Side Diff: src/checks.h

Issue 23248006: Move OS/compiler/feature detection to public v8config.h header. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Also add V8_ALIGNAS() there, required for the CPU profiler queue. Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 12 matching lines...) Expand all
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 27
28 #ifndef V8_CHECKS_H_ 28 #ifndef V8_CHECKS_H_
29 #define V8_CHECKS_H_ 29 #define V8_CHECKS_H_
30 30
31 #include <string.h> 31 #include <string.h>
32 32
33 #include "globals.h" 33 #include "../include/v8stdint.h"
34 34
35 extern "C" void V8_Fatal(const char* file, int line, const char* format, ...); 35 extern "C" void V8_Fatal(const char* file, int line, const char* format, ...);
36 36
37 // The FATAL, UNREACHABLE and UNIMPLEMENTED macros are useful during 37 // The FATAL, UNREACHABLE and UNIMPLEMENTED macros are useful during
38 // development, but they should not be relied on in the final product. 38 // development, but they should not be relied on in the final product.
39 #ifdef DEBUG 39 #ifdef DEBUG
40 #define FATAL(msg) \ 40 #define FATAL(msg) \
41 V8_Fatal(__FILE__, __LINE__, "%s", (msg)) 41 V8_Fatal(__FILE__, __LINE__, "%s", (msg))
42 #define UNIMPLEMENTED() \ 42 #define UNIMPLEMENTED() \
43 V8_Fatal(__FILE__, __LINE__, "unimplemented code") 43 V8_Fatal(__FILE__, __LINE__, "unimplemented code")
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 226
227 227
228 #define CHECK_GT(a, b) CHECK((a) > (b)) 228 #define CHECK_GT(a, b) CHECK((a) > (b))
229 #define CHECK_GE(a, b) CHECK((a) >= (b)) 229 #define CHECK_GE(a, b) CHECK((a) >= (b))
230 #define CHECK_LT(a, b) CHECK((a) < (b)) 230 #define CHECK_LT(a, b) CHECK((a) < (b))
231 #define CHECK_LE(a, b) CHECK((a) <= (b)) 231 #define CHECK_LE(a, b) CHECK((a) <= (b))
232 232
233 233
234 // Use C++11 static_assert if possible, which gives error 234 // Use C++11 static_assert if possible, which gives error
235 // messages that are easier to understand on first sight. 235 // messages that are easier to understand on first sight.
236 #if defined(V8_HAVE_CXX11_STATIC_ASSERT) 236 #if V8_HAS_CXX11_STATIC_ASSERT
237 #define STATIC_CHECK(test) static_assert(test, #test) 237 #define STATIC_CHECK(test) static_assert(test, #test)
238 #else 238 #else
239 // This is inspired by the static assertion facility in boost. This 239 // This is inspired by the static assertion facility in boost. This
240 // is pretty magical. If it causes you trouble on a platform you may 240 // is pretty magical. If it causes you trouble on a platform you may
241 // find a fix in the boost code. 241 // find a fix in the boost code.
242 template <bool> class StaticAssertion; 242 template <bool> class StaticAssertion;
243 template <> class StaticAssertion<true> { }; 243 template <> class StaticAssertion<true> { };
244 // This macro joins two tokens. If one of the tokens is a macro the 244 // This macro joins two tokens. If one of the tokens is a macro the
245 // helper call causes it to be resolved before joining. 245 // helper call causes it to be resolved before joining.
246 #define SEMI_STATIC_JOIN(a, b) SEMI_STATIC_JOIN_HELPER(a, b) 246 #define SEMI_STATIC_JOIN(a, b) SEMI_STATIC_JOIN_HELPER(a, b)
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 293
294 // "Extra checks" are lightweight checks that are enabled in some release 294 // "Extra checks" are lightweight checks that are enabled in some release
295 // builds. 295 // builds.
296 #ifdef ENABLE_EXTRA_CHECKS 296 #ifdef ENABLE_EXTRA_CHECKS
297 #define EXTRA_CHECK(condition) CHECK(condition) 297 #define EXTRA_CHECK(condition) CHECK(condition)
298 #else 298 #else
299 #define EXTRA_CHECK(condition) ((void) 0) 299 #define EXTRA_CHECK(condition) ((void) 0)
300 #endif 300 #endif
301 301
302 #endif // V8_CHECKS_H_ 302 #endif // V8_CHECKS_H_
OLDNEW
« include/v8config.h ('K') | « include/v8stdint.h ('k') | src/globals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698