return v.i;
}
-#ifdef __GLIBC__
+#if defined(__GLIBC__) || defined(__APPLE__)
# include <execinfo.h>
#endif
/* Avoid the strerror_r() prototype brain damage in glibc */
errno = error;
dprintf (2, " Error message: %m at:\n");
-
- void *stack[20];
- int len = backtrace (stack, sizeof (stack) / sizeof (stack[0]));
- backtrace_symbols_fd (stack, len, 2);
#else
char buf[1000];
const char *msg;
fflush (stderr);
#endif
+#if defined(__GLIBC__) || defined(__APPLE__)
+ void *stack[20];
+ int len = backtrace (stack, sizeof (stack) / sizeof (stack[0]));
+ backtrace_symbols_fd (stack, len, 2);
+#endif
+
abort ();
}
#else