From 659780b64323a5da3ff739c82d7d4c8efec21c39 Mon Sep 17 00:00:00 2001 From: "Devon H. O'Dell" Date: Wed, 18 Nov 2009 09:11:39 -0800 Subject: [PATCH] Add an intptr type to runtime; needed in FreeBSD In thread.c, we need to cast to whatever the native size of intptr is on the system, but we only have uintptr available. They're the same size, but can't do signed casts without this one :). R=rsc CC=golang-dev https://golang.org/cl/156073 --- src/pkg/runtime/freebsd/thread.c | 2 +- src/pkg/runtime/runtime.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pkg/runtime/freebsd/thread.c b/src/pkg/runtime/freebsd/thread.c index a4e1e13e51..5f44022365 100644 --- a/src/pkg/runtime/freebsd/thread.c +++ b/src/pkg/runtime/freebsd/thread.c @@ -141,7 +141,7 @@ newosproc(M *m, G *g, void *stk, void (*fn)(void)) param.arg = m; param.stack_base = stk; param.stack_size = g->stackbase - g->stackguard + 256; - param.child_tid = (int32*)&m->procid; + param.child_tid = (intptr*)&m->procid; param.parent_tid = nil; param.tls_base = (int8*)&m->tls[0]; param.tls_size = sizeof m->tls; diff --git a/src/pkg/runtime/runtime.h b/src/pkg/runtime/runtime.h index 83b47b7a33..df1c45ae1f 100644 --- a/src/pkg/runtime/runtime.h +++ b/src/pkg/runtime/runtime.h @@ -18,8 +18,10 @@ typedef double float64; #ifdef _64BIT typedef uint64 uintptr; +typedef int64 intptr; #else typedef uint32 uintptr; +typedef int32 intptr; #endif /*