From fd05abaff406bc83491373f7c539f30e6c876630 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 15 Oct 2012 19:41:27 +0200 Subject: [PATCH] cmake: Add a check for strsignal(). --- ConfigureChecks.cmake | 1 + src/cmocka.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 6e52232..e5c2f56 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -80,6 +80,7 @@ check_function_exists(memset HAVE_MEMSET) check_function_exists(printf HAVE_PRINTF) check_function_exists(setjmp HAVE_SETJMP) check_function_exists(signal HAVE_SIGNAL) +check_function_exists(strsignal HAVE_STRSIGNAL) check_function_exists(sprintf HAVE_SNPRINTF) check_function_exists(strcmp HAVE_STRCMP) check_function_exists(strcpy HAVE_STRCPY) diff --git a/src/cmocka.c b/src/cmocka.c index 8da2272..3db8a3f 100755 --- a/src/cmocka.c +++ b/src/cmocka.c @@ -1515,10 +1515,10 @@ void _fail(const char * const file, const int line) { #ifndef _WIN32 static void exception_handler(int sig) { -#ifdef _HPUX - print_error("%d\n", sig); -#else +#ifdef HAVE_STRSIGNAL print_error("%s\n", strsignal(sig)); +#else + print_error("%d\n", sig); #endif exit_test(1); } -- 2.7.4