From: Date: Thu, 30 Jul 2009 10:45:13 +0000 (+0000) Subject: Cast from pthread_t to pid_t via uintptr_t. X-Git-Tag: accepted/tizen/5.0/unified/20181102.024921~167 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1b5a90b691cc9a7dce4a79c0736b6c37ea065108;p=platform%2Fupstream%2Fglog.git Cast from pthread_t to pid_t via uintptr_t. On 64bit NetBSD, pthread_t is a pointer and pid_t is an integer so we cannot cast from pthread_t to pid_t directoly due to difference of their size. git-svn-id: https://google-glog.googlecode.com/svn/trunk@69 eb4d4688-79bd-11dd-afb4-1d65580434c0 --- diff --git a/src/utilities.cc b/src/utilities.cc index ec0e1b9..0c825b9 100644 --- a/src/utilities.cc +++ b/src/utilities.cc @@ -251,7 +251,7 @@ pid_t GetTID() { return GetCurrentThreadId(); #else // If none of the techniques above worked, we use pthread_self(). - return (pid_t)pthread_self(); + return (pid_t)(uintptr_t)pthread_self(); #endif }