httpclient: backtrace available when 'LIBC_HAS_BACKTRACE'
* IN THE SOFTWARE.
*/
#include <errno.h>
+#ifdef LIBC_HAS_BACKTRACE
#include <execinfo.h>
+#endif
#include <getopt.h>
#include <netinet/in.h>
#include <signal.h>
@@ -362,9 +364,11 @@ static void on_sigfatal(int signo)
h2o_set_signal_handler(signo, SIG_DFL);
+#ifdef LIBC_HAS_BACKTRACE
void *frames[128];
int framecnt = backtrace(frames, sizeof(frames) / sizeof(frames[0]));
backtrace_symbols_fd(frames, framecnt, 2);
+#endif
}
int main(int argc, char **argv)
