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

Side by Side Diff: sky/engine/wtf/Assertions.h

Issue 719063002: Revert "Remove support for MSVC" (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2013 Google Inc. All rights reserved. 3 * Copyright (C) 2013 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 if (!(assertion)) { \ 275 if (!(assertion)) { \
276 WTFReportArgumentAssertionFailure(__FILE__, __LINE__, WTF_PRETTY_FUNCTIO N, #argName, #assertion); \ 276 WTFReportArgumentAssertionFailure(__FILE__, __LINE__, WTF_PRETTY_FUNCTIO N, #argName, #assertion); \
277 CRASH(); \ 277 CRASH(); \
278 } \ 278 } \
279 while (0) 279 while (0)
280 280
281 #endif 281 #endif
282 282
283 /* COMPILE_ASSERT */ 283 /* COMPILE_ASSERT */
284 #ifndef COMPILE_ASSERT 284 #ifndef COMPILE_ASSERT
285 #if COMPILER_SUPPORTS(C_STATIC_ASSERT)
285 /* Unlike static_assert below, this also works in plain C code. */ 286 /* Unlike static_assert below, this also works in plain C code. */
286 #define COMPILE_ASSERT(exp, name) _Static_assert((exp), #name) 287 #define COMPILE_ASSERT(exp, name) _Static_assert((exp), #name)
288 #elif COMPILER_SUPPORTS(CXX_STATIC_ASSERT)
289 #define COMPILE_ASSERT(exp, name) static_assert((exp), #name)
290 #else
291 #define COMPILE_ASSERT(exp, name) typedef int dummy##name [(exp) ? 1 : -1]
292 #endif
287 #endif 293 #endif
288 294
289 /* FATAL */ 295 /* FATAL */
290 296
291 #if FATAL_DISABLED 297 #if FATAL_DISABLED
292 #define FATAL(...) ((void)0) 298 #define FATAL(...) ((void)0)
293 #else 299 #else
294 #define FATAL(...) do { \ 300 #define FATAL(...) do { \
295 WTFReportFatalError(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, __VA_ARGS__); \ 301 WTFReportFatalError(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, __VA_ARGS__); \
296 CRASH(); \ 302 CRASH(); \
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 } \ 394 } \
389 inline const thisType& to##thisType(const argumentType& argumentName) \ 395 inline const thisType& to##thisType(const argumentType& argumentName) \
390 { \ 396 { \
391 ASSERT_WITH_SECURITY_IMPLICATION(referencePredicate); \ 397 ASSERT_WITH_SECURITY_IMPLICATION(referencePredicate); \
392 return static_cast<const thisType&>(argumentName); \ 398 return static_cast<const thisType&>(argumentName); \
393 } \ 399 } \
394 void to##thisType(const thisType*); \ 400 void to##thisType(const thisType*); \
395 void to##thisType(const thisType&) 401 void to##thisType(const thisType&)
396 402
397 #endif /* WTF_Assertions_h */ 403 #endif /* WTF_Assertions_h */
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698