From: Lucio De Re Date: Mon, 25 Jul 2011 17:45:44 +0000 (-0400) Subject: build: define getcallerpc in u.h (fix for Plan 9 build) X-Git-Tag: weekly.2011-07-29~58 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=eb3f2083f91fa2c48bad4c997f5d8a4378aaf04e;p=gostls13.git build: define getcallerpc in u.h (fix for Plan 9 build) . By defining getcallerpc(x) as __builtin_return_address(0) here, it becomes possible to use the Plan 9 compatible form when compiling using GCC. The alternative is to add conditional compilation based on the compiler identity in "cmd/8g/gsubr.c" to distinguish between the two cases. R=golang-dev CC=golang-dev, rsc https://golang.org/cl/4800048 --- diff --git a/include/u.h b/include/u.h index 9ee7493b46..44bfcd63b2 100644 --- a/include/u.h +++ b/include/u.h @@ -194,6 +194,8 @@ typedef u64int uint64; #undef _NEEDUINT #undef _NEEDULONG +#define getcallerpc(x) __builtin_return_address(0) + #ifndef SIGBUS #define SIGBUS SIGSEGV /* close enough */ #endif