diff --git a/include/libtorrent/config.hpp b/include/libtorrent/config.hpp index 91da131f0..789d39ff7 100644 --- a/include/libtorrent/config.hpp +++ b/include/libtorrent/config.hpp @@ -192,6 +192,11 @@ POSSIBILITY OF SUCH DAMAGE. #endif // TORRENT_USE_OPENSSL #endif // MAC_OS_X_VERSION_MIN_REQUIRED +// execinfo.h is available in the MacOS X 10.5 SDK. +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 +#define TORRENT_USE_EXECINFO 1 +#endif + #endif // __APPLE__ #else @@ -212,6 +217,9 @@ POSSIBILITY OF SUCH DAMAGE. #define TORRENT_USE_IFCONF 1 #define TORRENT_HAS_SALEN 0 #define TORRENT_USE_POSIX_MEMALIGN 1 +#if __amd64__ || __i386__ +#define TORRENT_USE_EXECINFO 1 +#endif // ==== MINGW === #elif defined __MINGW32__ @@ -363,6 +371,10 @@ inline int snprintf(char* buf, int len, char const* fmt, ...) #define TORRENT_USE_NETLINK 0 #endif +#ifndef TORRENT_USE_EXECINFO +#define TORRENT_USE_EXECINFO 0 +#endif + #ifndef TORRENT_USE_SYSCTL #define TORRENT_USE_SYSCTL 0 #endif diff --git a/src/assert.cpp b/src/assert.cpp index a821043e3..92a728a5f 100644 --- a/src/assert.cpp +++ b/src/assert.cpp @@ -114,8 +114,7 @@ std::string demangle(char const* name) { return name; } #include #include "libtorrent/version.hpp" -// execinfo.h is available in the MacOS X 10.5 SDK. -#if (defined __linux__ || (defined __APPLE__ && MAC_OS_X_VERSION_MIN_REQUIRED >= 1050)) +#if TORRENT_USE_EXECINFO #include TORRENT_EXPORT void print_backtrace(char* out, int len, int max_depth)