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

Side by Side Diff: base/logging.h

Issue 2706143002: Fix win-clang build (Closed)
Patch Set: Use static_csat Created 3 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BASE_LOGGING_H_ 5 #ifndef BASE_LOGGING_H_
6 #define BASE_LOGGING_H_ 6 #define BASE_LOGGING_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <cassert> 10 #include <cassert>
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 503
504 // Clang is cleverer about coalescing int3s, so we need to add a unique-ish 504 // Clang is cleverer about coalescing int3s, so we need to add a unique-ish
505 // instruction following the __debugbreak() to have it emit distinct locations 505 // instruction following the __debugbreak() to have it emit distinct locations
506 // for CHECKs rather than collapsing them all together. It would be nice to use 506 // for CHECKs rather than collapsing them all together. It would be nice to use
507 // a short intrinsic to do this (and perhaps have only one implementation for 507 // a short intrinsic to do this (and perhaps have only one implementation for
508 // both clang and MSVC), however clang-cl currently does not support intrinsics 508 // both clang and MSVC), however clang-cl currently does not support intrinsics
509 // here. Adding the nullptr store to the MSVC path adds unnecessary bloat. 509 // here. Adding the nullptr store to the MSVC path adds unnecessary bloat.
510 // TODO(scottmg): Reinvestigate a short sequence that will work on both 510 // TODO(scottmg): Reinvestigate a short sequence that will work on both
511 // compilers once clang supports more intrinsics. See https://crbug.com/693713. 511 // compilers once clang supports more intrinsics. See https://crbug.com/693713.
512 #if defined(__clang__) 512 #if defined(__clang__)
513 #define IMMEDIATE_CRASH() \ 513 #define IMMEDIATE_CRASH() \
514 (__debugbreak(), \ 514 (__debugbreak(), (void)(*reinterpret_cast<volatile unsigned char*>(0) = \
515 (void)(*reinterpret_cast<volatile unsigned char*>(0) = __COUNTER__)) 515 static_cast<unsigned char>(__COUNTER__)))
516 #else 516 #else
517 #define IMMEDIATE_CRASH() __debugbreak() 517 #define IMMEDIATE_CRASH() __debugbreak()
518 #endif // __clang__ 518 #endif // __clang__
519 519
520 #else 520 #else
521 #error Port 521 #error Port
522 #endif 522 #endif
523 523
524 // CHECK dies with a fatal error if condition is not true. It is *not* 524 // CHECK dies with a fatal error if condition is not true. It is *not*
525 // controlled by NDEBUG, so the check will be executed regardless of 525 // controlled by NDEBUG, so the check will be executed regardless of
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
1073 #elif NOTIMPLEMENTED_POLICY == 5 1073 #elif NOTIMPLEMENTED_POLICY == 5
1074 #define NOTIMPLEMENTED() do {\ 1074 #define NOTIMPLEMENTED() do {\
1075 static bool logged_once = false;\ 1075 static bool logged_once = false;\
1076 LOG_IF(ERROR, !logged_once) << NOTIMPLEMENTED_MSG;\ 1076 LOG_IF(ERROR, !logged_once) << NOTIMPLEMENTED_MSG;\
1077 logged_once = true;\ 1077 logged_once = true;\
1078 } while(0);\ 1078 } while(0);\
1079 EAT_STREAM_PARAMETERS 1079 EAT_STREAM_PARAMETERS
1080 #endif 1080 #endif
1081 1081
1082 #endif // BASE_LOGGING_H_ 1082 #endif // BASE_LOGGING_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698