diff options
| -rw-r--r-- | base/logging.cpp | 8 | ||||
| -rw-r--r-- | include/utils/ThreadDefs.h | 4 | ||||
| -rw-r--r-- | liblog/fake_log_device.c | 4 | ||||
| -rw-r--r-- | libutils/Android.mk | 4 | ||||
| -rw-r--r-- | libutils/ProcessCallStack.cpp | 2 |
5 files changed, 17 insertions, 5 deletions
diff --git a/base/logging.cpp b/base/logging.cpp index a385902e8..174187149 100644 --- a/base/logging.cpp +++ b/base/logging.cpp @@ -68,7 +68,13 @@ #include <windows.h> #endif -static pid_t GetThreadId() { +#if defined(_WIN32) +typedef uint32_t thread_id; +#else +typedef pid_t thread_id; +#endif + +static thread_id GetThreadId() { #if defined(__BIONIC__) return gettid(); #elif defined(__APPLE__) diff --git a/include/utils/ThreadDefs.h b/include/utils/ThreadDefs.h index 9711c1379..ae091e40f 100644 --- a/include/utils/ThreadDefs.h +++ b/include/utils/ThreadDefs.h @@ -29,7 +29,11 @@ extern "C" { #endif +#ifdef _WIN32 +typedef uint32_t android_thread_id_t; +#else typedef void* android_thread_id_t; +#endif typedef int (*android_thread_func_t)(void*); diff --git a/liblog/fake_log_device.c b/liblog/fake_log_device.c index cb80ee63c..5f7a078c7 100644 --- a/liblog/fake_log_device.c +++ b/liblog/fake_log_device.c @@ -367,7 +367,11 @@ static void showLog(LogState *state, char prefixBuf[128], suffixBuf[128]; char priChar; time_t when; +#if !defined(_WIN32) pid_t pid, tid; +#else + uint32_t pid, tid; +#endif TRACE("LOG %d: %s %s", logPrio, tag, msg); diff --git a/libutils/Android.mk b/libutils/Android.mk index 631b5a3b4..3663c52b7 100644 --- a/libutils/Android.mk +++ b/libutils/Android.mk @@ -22,7 +22,6 @@ commonSources:= \ Log.cpp \ NativeHandle.cpp \ Printer.cpp \ - ProcessCallStack.cpp \ PropertyMap.cpp \ RefBase.cpp \ SharedBuffer.cpp \ @@ -44,7 +43,7 @@ host_commonCflags := -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) -Werror # ===================================================== include $(CLEAR_VARS) LOCAL_SRC_FILES:= $(commonSources) -LOCAL_SRC_FILES_linux := Looper.cpp +LOCAL_SRC_FILES_linux := Looper.cpp ProcessCallStack.cpp LOCAL_CFLAGS_darwin := -Wno-unused-parameter LOCAL_MODULE:= libutils LOCAL_STATIC_LIBRARIES := liblog @@ -67,6 +66,7 @@ LOCAL_SRC_FILES:= \ $(commonSources) \ BlobCache.cpp \ Looper.cpp \ + ProcessCallStack.cpp \ Trace.cpp ifeq ($(TARGET_ARCH),mips) diff --git a/libutils/ProcessCallStack.cpp b/libutils/ProcessCallStack.cpp index 011c30291..cdb586d98 100644 --- a/libutils/ProcessCallStack.cpp +++ b/libutils/ProcessCallStack.cpp @@ -146,7 +146,6 @@ void ProcessCallStack::update() { clear(); // Get current time. -#ifndef USE_MINGW { time_t t = time(NULL); struct tm tm; @@ -199,7 +198,6 @@ void ProcessCallStack::update() { ALOGE("%s: Failed to readdir from %s: %s", __FUNCTION__, PATH_SELF_TASK, strerror(code)); } -#endif closedir(dp); } |
