summaryrefslogtreecommitdiff
path: root/src/common/nullpo.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/nullpo.c')
-rw-r--r--src/common/nullpo.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/common/nullpo.c b/src/common/nullpo.c
index 395002b64..0db714ae1 100644
--- a/src/common/nullpo.c
+++ b/src/common/nullpo.c
@@ -12,9 +12,9 @@
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
-#if defined(__GNUC__) && !defined(CYGWIN)
+#ifdef HAVE_EXECINFO
#include <execinfo.h>
-#endif
+#endif // HAVE_EXECINFO
struct nullpo_interface nullpo_s;
@@ -28,12 +28,12 @@ struct nullpo_interface nullpo_s;
* @param title Message title to display (i.e. failed assertion or nullpo info)
*/
void assert_report(const char *file, int line, const char *func, const char *targetname, const char *title) {
-#if defined(__GNUC__) && !defined(CYGWIN)
+#ifdef HAVE_EXECINFO
void *array[10];
int size;
char **strings;
int i;
-#endif
+#endif // HAVE_EXECINFO
if (file == NULL)
file = "??";
@@ -42,13 +42,13 @@ void assert_report(const char *file, int line, const char *func, const char *tar
ShowError("--- %s --------------------------------------------\n", title);
ShowError("%s:%d: '%s' in function `%s'\n", file, line, targetname, func);
-#if defined(__GNUC__) && !defined(CYGWIN)
+#ifdef HAVE_EXECINFO
size = (int)backtrace(array, 10);
strings = backtrace_symbols(array, size);
for (i = 0; i < size; i++)
ShowError("%s\n", strings[i]);
free(strings);
-#endif
+#endif // HAVE_EXECINFO
ShowError("--- end %s ----------------------------------------\n", title);
}