/*
+--------------------------------------------------------------------+
- | libmemcached - C/C++ Client Library for memcached |
+ | libmemcached-awesome - C/C++ Client Library for memcached |
+--------------------------------------------------------------------+
| Redistribution and use in source and binary forms, with or without |
| modification, are permitted under the terms of the BSD license. |
| the terms online at: https://opensource.org/licenses/BSD-3-Clause |
+--------------------------------------------------------------------+
| Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ |
- | Copyright (c) 2020 Michael Wallner <mike@php.net> |
+ | Copyright (c) 2020-2021 Michael Wallner https://awesome.co/ |
+--------------------------------------------------------------------+
*/
# include BACKTRACE_HEADER
-# if HAVE_ABI____CXA_DEMANGLE
+# ifdef HAVE_ABI____CXA_DEMANGLE
# include <cxxabi.h>
-# define USE_DEMANGLE 1
-# else
-# define USE_DEMANGLE 0
# endif
# ifdef HAVE_DLFCN_H
for (int x = 0; x < stack_frames; x++) {
bool was_demangled = false;
- if (USE_DEMANGLE) {
-# ifdef HAVE_DLFCN_H
+# ifdef HAVE_ABI____CXA_DEMANGLE
+# ifdef HAVE_DLFCN_H
Dl_info dlinfo;
if (dladdr(backtrace_buffer[x], &dlinfo)) {
char demangled_buffer[1024];
dlinfo.dli_fname);
}
}
+# endif
# endif
- }
if (was_demangled == false) {
fprintf(stderr, "?%d %p in %s\n", x, backtrace_buffer[x], symbollist[x]);