summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
author <shinichiro.hamaji@gmail.com>2009-07-27 05:31:23 +0000
committer <shinichiro.hamaji@gmail.com>2009-07-27 05:31:23 +0000
commit70cb94e24422f1d5c258bcb1ede8f51d82a9812b (patch)
treea81243ada19b5992ec6a1c4c050028a40318a89c /src
parentd96287aa28dcba7bddfcf9598925eaf70038150e (diff)
downloadglog-70cb94e24422f1d5c258bcb1ede8f51d82a9812b.tar.gz
glog-70cb94e24422f1d5c258bcb1ede8f51d82a9812b.tar.bz2
glog-70cb94e24422f1d5c258bcb1ede8f51d82a9812b.zip
Add cast for pthread_self() to avoid warning.
git-svn-id: https://google-glog.googlecode.com/svn/trunk@59 eb4d4688-79bd-11dd-afb4-1d65580434c0
Diffstat (limited to 'src')
-rw-r--r--src/signalhandler_unittest.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/signalhandler_unittest.cc b/src/signalhandler_unittest.cc
index 05a5b96..5493e52 100644
--- a/src/signalhandler_unittest.cc
+++ b/src/signalhandler_unittest.cc
@@ -44,7 +44,12 @@
using namespace GOOGLE_NAMESPACE;
void* DieInThread(void*) {
- fprintf(stderr, "0x%lx is dying\n", pthread_self());
+ // We assume pthread_t is an integral number or a pointer, rather
+ // than a complex struct. In some environments, pthread_self()
+ // returns an uint64 but in some other environments pthread_self()
+ // returns a pointer. Hence we use C-style cast here, rather than
+ // reinterpret/static_cast, to support both types of environments.
+ fprintf(stderr, "0x%lx is dying\n", (long)pthread_self());
// Use volatile to prevent from these to be optimized away.
volatile int a = 0;
volatile int b = 1 / a;