test: fix FreeBSD compilation
Use sighandler_t only on Linux, as it is the only OS
that has this type (use void * if other OS).
Also, this commit fixes a warning on function "seg_handler",
in direct_api.test.c.
function 'seg_handler' could be declared with attribute 'noreturn' [-Wmissing-noreturn]
This commit is part of fix for
@@ -49,6 +49,9 @@ direct_api_test(struct IMB_MGR *mb_mgr);
jmp_buf env;
#ifndef DEBUG
+#ifndef _WIN32
+static void seg_handler(int signum) __attribute__((noreturn));
+#endif
/* Signal handler to handle segfaults */
static void
seg_handler(int signum)
@@ -1114,10 +1117,10 @@ direct_api_test(struct IMB_MGR *mb_mgr)
{
int errors = 0;
#ifndef DEBUG
-#ifdef _WIN32
- void *handler;
-#else
+#if defined(__linux__)
sighandler_t handler;
+#else
+ void *handler;
#endif
#endif
printf("Invalid Direct API arguments test:\n");
