mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-01-06 13:10:33 +01:00
[trace] Check for __builtin_return_address explicitly.
Some other compilers such as clang and icc support the __builtin_return_address() intrinsic as well, so we don't need to check for __GNUC__ >= 3 only.
This commit is contained in:
parent
2b0e070f6a
commit
b509b548b1
2 changed files with 13 additions and 1 deletions
|
|
@ -73,6 +73,18 @@ dnl ====================================================================
|
|||
dnl Header/function checks
|
||||
dnl ====================================================================
|
||||
|
||||
dnl check if we have a __builtin_return_address for the cairo-trace
|
||||
dnl utility.
|
||||
AC_MSG_CHECKING([for __builtin_return_address(0)])
|
||||
AC_TRY_COMPILE([],[__builtin_return_address(0);],
|
||||
[have_builtin_return_address=yes],
|
||||
[have_builtin_return_address=no])
|
||||
AC_MSG_RESULT($have_builtin_return_address)
|
||||
if test "x$have_builtin_return_address" = "xyes"; then
|
||||
AC_DEFINE(HAVE_BUILTIN_RETURN_ADDRESS, 1,
|
||||
[Define to 1 if your compiler supports the __builtin_return_address() intrinsic.])
|
||||
fi
|
||||
|
||||
dnl Checks for precise integer types
|
||||
AC_CHECK_HEADERS([stdint.h inttypes.h sys/int_types.h])
|
||||
AC_CHECK_TYPES([uint64_t, uint128_t])
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ static bool _line_info;
|
|||
static bool _mark_dirty;
|
||||
static const cairo_user_data_key_t destroy_key;
|
||||
|
||||
#if __GNUC__ >= 3
|
||||
#if HAVE_BUILTIN_RETURN_ADDRESS
|
||||
#define _emit_line_info() do { \
|
||||
if (_line_info && _write_lock ()) { \
|
||||
void *addr = __builtin_return_address(0); \
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue