diff --git a/src/sna/xassert.h b/src/sna/xassert.h index 7252ae82..1bcfd080 100644 --- a/src/sna/xassert.h +++ b/src/sna/xassert.h @@ -33,9 +33,15 @@ #ifndef NDEBUG #include #include "compiler.h" + +#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1,6,0,0,0) +#define xorg_backtrace() +#endif + #undef assert -#define assert(E) do { \ - if (unlikely(!(E))) FatalError("%s:%d assertion '%s' failed\n", __func__, __LINE__, #E); \ +#define assert(E) do if (unlikely(!(E))) { \ + xorg_backtrace(); \ + FatalError("%s:%d assertion '%s' failed\n", __func__, __LINE__, #E); \ } while (0) #endif