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

Side by Side Diff: base/logging.h

Issue 1467003002: Switch to static_assert in base/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: / Created 5 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
« no previous file with comments | « base/json/string_escape.cc ('k') | base/mac/foundation_util_unittest.mm » ('j') | 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 <cassert> 8 #include <cassert>
9 #include <string> 9 #include <string>
10 #include <cstring> 10 #include <cstring>
(...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after
945 // of the current function in the NOTIMPLEMENTED message. 945 // of the current function in the NOTIMPLEMENTED message.
946 #define NOTIMPLEMENTED_MSG "Not implemented reached in " << __PRETTY_FUNCTION__ 946 #define NOTIMPLEMENTED_MSG "Not implemented reached in " << __PRETTY_FUNCTION__
947 #else 947 #else
948 #define NOTIMPLEMENTED_MSG "NOT IMPLEMENTED" 948 #define NOTIMPLEMENTED_MSG "NOT IMPLEMENTED"
949 #endif 949 #endif
950 950
951 #if NOTIMPLEMENTED_POLICY == 0 951 #if NOTIMPLEMENTED_POLICY == 0
952 #define NOTIMPLEMENTED() EAT_STREAM_PARAMETERS 952 #define NOTIMPLEMENTED() EAT_STREAM_PARAMETERS
953 #elif NOTIMPLEMENTED_POLICY == 1 953 #elif NOTIMPLEMENTED_POLICY == 1
954 // TODO, figure out how to generate a warning 954 // TODO, figure out how to generate a warning
955 #define NOTIMPLEMENTED() COMPILE_ASSERT(false, NOT_IMPLEMENTED) 955 #define NOTIMPLEMENTED() static_assert(false, "NOT_IMPLEMENTED")
956 #elif NOTIMPLEMENTED_POLICY == 2 956 #elif NOTIMPLEMENTED_POLICY == 2
957 #define NOTIMPLEMENTED() COMPILE_ASSERT(false, NOT_IMPLEMENTED) 957 #define NOTIMPLEMENTED() static_assert(false, "NOT_IMPLEMENTED")
958 #elif NOTIMPLEMENTED_POLICY == 3 958 #elif NOTIMPLEMENTED_POLICY == 3
959 #define NOTIMPLEMENTED() NOTREACHED() 959 #define NOTIMPLEMENTED() NOTREACHED()
960 #elif NOTIMPLEMENTED_POLICY == 4 960 #elif NOTIMPLEMENTED_POLICY == 4
961 #define NOTIMPLEMENTED() LOG(ERROR) << NOTIMPLEMENTED_MSG 961 #define NOTIMPLEMENTED() LOG(ERROR) << NOTIMPLEMENTED_MSG
962 #elif NOTIMPLEMENTED_POLICY == 5 962 #elif NOTIMPLEMENTED_POLICY == 5
963 #define NOTIMPLEMENTED() do {\ 963 #define NOTIMPLEMENTED() do {\
964 static bool logged_once = false;\ 964 static bool logged_once = false;\
965 LOG_IF(ERROR, !logged_once) << NOTIMPLEMENTED_MSG;\ 965 LOG_IF(ERROR, !logged_once) << NOTIMPLEMENTED_MSG;\
966 logged_once = true;\ 966 logged_once = true;\
967 } while(0);\ 967 } while(0);\
968 EAT_STREAM_PARAMETERS 968 EAT_STREAM_PARAMETERS
969 #endif 969 #endif
970 970
971 #endif // BASE_LOGGING_H_ 971 #endif // BASE_LOGGING_H_
OLDNEW
« no previous file with comments | « base/json/string_escape.cc ('k') | base/mac/foundation_util_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698