diff options
author | derat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-23 19:57:46 +0000 |
---|---|---|
committer | derat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-23 19:57:46 +0000 |
commit | ff3d0c3a57b0be4f333bbbc5caeb95cd10f42f96 (patch) | |
tree | 6f289822ee98d127e837941d2d12dee6bf114f9c /base/logging.cc | |
parent | 753a1cd3dbd242201d86c216ed1b80b7a0d0a139 (diff) | |
download | chromium_src-ff3d0c3a57b0be4f333bbbc5caeb95cd10f42f96.zip chromium_src-ff3d0c3a57b0be4f333bbbc5caeb95cd10f42f96.tar.gz chromium_src-ff3d0c3a57b0be4f333bbbc5caeb95cd10f42f96.tar.bz2 |
base: Disallow mixing NDEBUG settings in logging.{h,cc}.
I am concerned about the possibility that other users of the
files in Chrome's base/ directory (e.g. Chrome OS) may build
a library from these files with NDEBUG defined and then link
it into a binary that includes the headers without defining
NDEBUG, or vice versa.
This change mangles InitLogging()'s name in logging.h based
on whether NDEBUG is defined so that linking will fail if
there's a mismatch (Evan provided useful advice here).
BUG=chromium-os:1124
TEST=built Debug and Release Chrome, built all Chrome OS packages, and then changed a Chrome OS package that links against libbase.a to define NDEBUG and checked that it failed to link
Review URL: http://codereview.chromium.org/3106032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57098 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/logging.cc')
-rw-r--r-- | base/logging.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/base/logging.cc b/base/logging.cc index 2d61910..f90a369 100644 --- a/base/logging.cc +++ b/base/logging.cc @@ -82,10 +82,8 @@ const int kAlwaysPrintErrorLevel = LOG_ERROR; // will be lazily initialized to the default value when it is // first needed. #if defined(OS_WIN) -typedef wchar_t PathChar; typedef std::wstring PathString; #else -typedef char PathChar; typedef std::string PathString; #endif PathString* log_file_name = NULL; @@ -248,8 +246,10 @@ void InitLogMutex() { #endif } -void InitLogging(const PathChar* new_log_file, LoggingDestination logging_dest, - LogLockingState lock_log, OldFileDeletionState delete_old) { +void BaseInitLoggingImpl(const PathChar* new_log_file, + LoggingDestination logging_dest, + LogLockingState lock_log, + OldFileDeletionState delete_old) { g_enable_dcheck = CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableDCHECK); |