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

Side by Side Diff: base/logging.h

Issue 12221152: Fix compile breakage when using stream operators when NOTIMPLEMENTED_POLICY=5. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use bool instead of counter to detect 'run once.' Created 7 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 | Annotate | Revision Log
« 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 <cassert> 8 #include <cassert>
9 #include <string> 9 #include <string>
10 #include <cstring> 10 #include <cstring>
(...skipping 962 matching lines...) Expand 10 before | Expand all | Expand 10 after
973 // TODO, figure out how to generate a warning 973 // TODO, figure out how to generate a warning
974 #define NOTIMPLEMENTED() COMPILE_ASSERT(false, NOT_IMPLEMENTED) 974 #define NOTIMPLEMENTED() COMPILE_ASSERT(false, NOT_IMPLEMENTED)
975 #elif NOTIMPLEMENTED_POLICY == 2 975 #elif NOTIMPLEMENTED_POLICY == 2
976 #define NOTIMPLEMENTED() COMPILE_ASSERT(false, NOT_IMPLEMENTED) 976 #define NOTIMPLEMENTED() COMPILE_ASSERT(false, NOT_IMPLEMENTED)
977 #elif NOTIMPLEMENTED_POLICY == 3 977 #elif NOTIMPLEMENTED_POLICY == 3
978 #define NOTIMPLEMENTED() NOTREACHED() 978 #define NOTIMPLEMENTED() NOTREACHED()
979 #elif NOTIMPLEMENTED_POLICY == 4 979 #elif NOTIMPLEMENTED_POLICY == 4
980 #define NOTIMPLEMENTED() LOG(ERROR) << NOTIMPLEMENTED_MSG 980 #define NOTIMPLEMENTED() LOG(ERROR) << NOTIMPLEMENTED_MSG
981 #elif NOTIMPLEMENTED_POLICY == 5 981 #elif NOTIMPLEMENTED_POLICY == 5
982 #define NOTIMPLEMENTED() do {\ 982 #define NOTIMPLEMENTED() do {\
983 static int count = 0;\ 983 static bool logged_once = false;\
984 LOG_IF(ERROR, 0 == count++) << NOTIMPLEMENTED_MSG;\ 984 LOG_IF(ERROR, !logged_once) << NOTIMPLEMENTED_MSG;\
985 } while(0) 985 logged_once = true;\
986 } while(0);\
987 EAT_STREAM_PARAMETERS
986 #endif 988 #endif
987 989
988 #endif // BASE_LOGGING_H_ 990 #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