diff options
author | Josh Gao <jmgao@google.com> | 2015-11-12 11:54:47 -0800 |
---|---|---|
committer | Josh Gao <jmgao@google.com> | 2015-11-12 11:54:47 -0800 |
commit | 7df6b5fc79a0f4521d171280cd431640ac567d27 (patch) | |
tree | 75b1bb9e180a2d0001065a56962014f07720d768 /base | |
parent | b7b1edf974a93cc4bb9a2de7a5e9c9bce9ad178b (diff) | |
download | system_core-7df6b5fc79a0f4521d171280cd431640ac567d27.tar.gz system_core-7df6b5fc79a0f4521d171280cd431640ac567d27.tar.bz2 system_core-7df6b5fc79a0f4521d171280cd431640ac567d27.zip |
libbase: remove exit-time destructors.
Removed for the same reason as the adb exit-time destructors.
Bug: http://b/23384853
Change-Id: Ic124ecb9df132b850a3855e207baffec926dde29
Diffstat (limited to 'base')
-rw-r--r-- | base/Android.mk | 10 | ||||
-rw-r--r-- | base/logging.cpp | 8 |
2 files changed, 13 insertions, 5 deletions
diff --git a/base/Android.mk b/base/Android.mk index 613636b61..5a0ad05c3 100644 --- a/base/Android.mk +++ b/base/Android.mk @@ -36,6 +36,12 @@ libbase_cppflags := \ -Wextra \ -Werror \ +libbase_linux_cppflags := \ + -Wexit-time-destructors \ + +libbase_darwin_cppflags := \ + -Wexit-time-destructors \ + # Device # ------------------------------------------------------------------------------ include $(CLEAR_VARS) @@ -43,7 +49,7 @@ LOCAL_MODULE := libbase LOCAL_CLANG := true LOCAL_SRC_FILES := $(libbase_src_files) LOCAL_C_INCLUDES := $(LOCAL_PATH)/include -LOCAL_CPPFLAGS := $(libbase_cppflags) +LOCAL_CPPFLAGS := $(libbase_cppflags) $(libbase_linux_cppflags) LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include LOCAL_STATIC_LIBRARIES := libcutils LOCAL_MULTILIB := both @@ -66,6 +72,8 @@ LOCAL_MODULE := libbase LOCAL_SRC_FILES := $(libbase_src_files) LOCAL_C_INCLUDES := $(LOCAL_PATH)/include LOCAL_CPPFLAGS := $(libbase_cppflags) +LOCAL_CPPFLAGS_darwin := $(libbase_darwin_cppflags) +LOCAL_CPPFLAGS_linux := $(libbase_linux_cppflags) LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include LOCAL_STATIC_LIBRARIES := libcutils LOCAL_MULTILIB := both diff --git a/base/logging.cpp b/base/logging.cpp index 248cd0617..d88455fcb 100644 --- a/base/logging.cpp +++ b/base/logging.cpp @@ -127,17 +127,17 @@ class lock_guard { namespace android { namespace base { -static mutex logging_lock; +static auto& logging_lock = *new mutex(); #ifdef __ANDROID__ -static LogFunction gLogger = LogdLogger(); +static auto& gLogger = *new LogFunction(LogdLogger()); #else -static LogFunction gLogger = StderrLogger; +static auto& gLogger = *new LogFunction(StderrLogger); #endif static bool gInitialized = false; static LogSeverity gMinimumLogSeverity = INFO; -static std::unique_ptr<std::string> gProgramInvocationName; +static auto& gProgramInvocationName = *new std::unique_ptr<std::string>(); LogSeverity GetMinimumLogSeverity() { return gMinimumLogSeverity; |