Commit b70ff014 authored by miu@chromium.org's avatar miu@chromium.org

Fix compile breakage when using stream operators when NOTIMPLEMENTED_POLICY=5.

In logging.h, the NOTIMPLEMENTED_POLICY macro defines the behavior of the NOTIMPLEMENTED() macro.  For case 5 (log only once per call-site), code that uses stream output operators would fail to compile.  For example, in ui/aura/root_window_host_linux.cc:747:

  NOTIMPLEMENTED() << "Unsupported bits-per-pixel " << image->bits_per_pixel;

The solution is to add EAT_STREAM_PARAMETERS to the end of the definition in base/logging.h.  This will log call sites as "not implemented" but will not log the additional custom messages.

TEST=Compiled chrome with compiler define set to NOTIMPLEMENTED_POLICY=5 and ran to confirm desired NOTIMPLEMENTED() behaviors.


Review URL: https://chromiumcodereview.appspot.com/12221152

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@182167 0039d316-1c4b-4281-b951-d872f2087c98
parent 10791706
...@@ -980,9 +980,11 @@ inline std::ostream& operator<<(std::ostream& out, const std::wstring& wstr) { ...@@ -980,9 +980,11 @@ inline std::ostream& operator<<(std::ostream& out, const std::wstring& wstr) {
#define NOTIMPLEMENTED() LOG(ERROR) << NOTIMPLEMENTED_MSG #define NOTIMPLEMENTED() LOG(ERROR) << NOTIMPLEMENTED_MSG
#elif NOTIMPLEMENTED_POLICY == 5 #elif NOTIMPLEMENTED_POLICY == 5
#define NOTIMPLEMENTED() do {\ #define NOTIMPLEMENTED() do {\
static int count = 0;\ static bool logged_once = false;\
LOG_IF(ERROR, 0 == count++) << NOTIMPLEMENTED_MSG;\ LOG_IF(ERROR, !logged_once) << NOTIMPLEMENTED_MSG;\
} while(0) logged_once = true;\
} while(0);\
EAT_STREAM_PARAMETERS
#endif #endif
#endif // BASE_LOGGING_H_ #endif // BASE_LOGGING_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment