summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2013-08-25 09:59:42 +0400
committerIvan Maidanski <ivmai@mail.ru>2013-08-25 09:59:42 +0400
commitadec1d2ac5c84eb9e9b001da9f0e179e49e1972d (patch)
tree0926b1ffdc0acaf8d47886d1257502d7e4c0d7fb
parent4e166ca7d7c02e31b3bd597234e0da133c49afc7 (diff)
downloadbdwgc-freebsd-ports-devel-boehm-gc.tar.gz
Use __builtin_extract_return_addr in GC_RETURN_ADDR_PARENT (gcc/x86)gc7_2d-freebsdfreebsd-ports-devel-boehm-gc
* include/gc_config_macros.h (GC_RETURN_ADDR_PARENT): Use __builtin_extract_return_addr (since the address passed to dladdr); do not define the macro for GCC pre-v4.
-rw-r--r--include/gc_config_macros.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/gc_config_macros.h b/include/gc_config_macros.h
index eba31205..bcd3643a 100644
--- a/include/gc_config_macros.h
+++ b/include/gc_config_macros.h
@@ -287,9 +287,10 @@
/* gcc knows how to retrieve return address, but we don't know */
/* how to generate call stacks. */
# define GC_RETURN_ADDR (GC_word)__builtin_return_address(0)
-# if defined(__i386__) || defined(__amd64__) \
- || defined(__x86_64__) /* and probably others... */
-# define GC_RETURN_ADDR_PARENT (GC_word)__builtin_return_address(1)
+# if (__GNUC__ >= 4) && (defined(__i386__) || defined(__amd64__) \
+ || defined(__x86_64__) /* and probably others... */)
+# define GC_RETURN_ADDR_PARENT \
+ (GC_word)__builtin_extract_return_addr(__builtin_return_address(1))
# endif
# else
/* Just pass 0 for gcc compatibility. */