From 87d39f39b357fe40432a2859366ae63a01d2a62c Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Fri, 11 Mar 2016 13:32:28 +0000 Subject: [PATCH 1/2] WIN32: Need getpid() declaration --- contrib/otshell_utils/utils.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/otshell_utils/utils.cpp b/contrib/otshell_utils/utils.cpp index e1d7d9a1..bbae7c65 100644 --- a/contrib/otshell_utils/utils.cpp +++ b/contrib/otshell_utils/utils.cpp @@ -32,6 +32,7 @@ #if defined(OS_TYPE_WINDOWS) #include + #include #elif defined(OS_TYPE_POSIX) #include #include From 52056dcfc480a126e06afaf209b1772b6aa77fb3 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Fri, 11 Mar 2016 14:11:01 +0000 Subject: [PATCH 2/2] WIN32 thread_id is OS-dependent not compiler-dependent --- contrib/epee/include/misc_os_dependent.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/contrib/epee/include/misc_os_dependent.h b/contrib/epee/include/misc_os_dependent.h index 4d9c991e..2abca044 100644 --- a/contrib/epee/include/misc_os_dependent.h +++ b/contrib/epee/include/misc_os_dependent.h @@ -52,6 +52,12 @@ namespace misc_utils { #if defined(_MSC_VER) return ::GetTickCount64(); +#elif defined(WIN32) +# if defined(WIN64) + return GetTickCount64(); +# else + return GetTickCount(); +# endif #elif defined(__MACH__) clock_serv_t cclock; mach_timespec_t mts; @@ -98,7 +104,7 @@ namespace misc_utils inline std::string get_thread_string_id() { -#if defined(_MSC_VER) +#if defined(_WIN32) return boost::lexical_cast(GetCurrentThreadId()); #elif defined(__GNUC__) return boost::lexical_cast(pthread_self());