summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorJosh Gao <jmgao@google.com>2015-11-12 22:50:03 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-11-12 22:50:03 +0000
commit26f2e1fd4ff02cb8a3927c86a90656269ebcb412 (patch)
tree155c9d50afb6d86c1014aeb2c1c8a60b88274f04 /base
parent8591f719d0c7f8db6bd5dc742e0d210afb12eb03 (diff)
parent7df6b5fc79a0f4521d171280cd431640ac567d27 (diff)
downloadsystem_core-26f2e1fd4ff02cb8a3927c86a90656269ebcb412.tar.gz
system_core-26f2e1fd4ff02cb8a3927c86a90656269ebcb412.tar.bz2
system_core-26f2e1fd4ff02cb8a3927c86a90656269ebcb412.zip
Merge changes Ic124ecb9,I94de55d2
* changes: libbase: remove exit-time destructors. adb: remove exit-time destructors.
Diffstat (limited to 'base')
-rw-r--r--base/Android.mk10
-rw-r--r--base/logging.cpp8
2 files changed, 13 insertions, 5 deletions
diff --git a/base/Android.mk b/base/Android.mk
index 4e6bd10a2..cba70d4c9 100644
--- a/base/Android.mk
+++ b/base/Android.mk
@@ -42,6 +42,12 @@ libbase_cppflags := \
-Wextra \
-Werror \
+libbase_linux_cppflags := \
+ -Wexit-time-destructors \
+
+libbase_darwin_cppflags := \
+ -Wexit-time-destructors \
+
# Device
# ------------------------------------------------------------------------------
include $(CLEAR_VARS)
@@ -52,7 +58,7 @@ LOCAL_SRC_FILES_darwin := $(libbase_darwin_src_files)
LOCAL_SRC_FILES_linux := $(libbase_linux_src_files)
LOCAL_SRC_FILES_windows := $(libbase_windows_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
@@ -78,6 +84,8 @@ LOCAL_SRC_FILES_linux := $(libbase_linux_src_files)
LOCAL_SRC_FILES_windows := $(libbase_windows_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 01a046a0f..85f8b3fad 100644
--- a/base/logging.cpp
+++ b/base/logging.cpp
@@ -154,17 +154,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;