shithub: libsamplerate

Download patch

ref: a0ea6cbe1459b6efc3ecd504fe94d49e54a3e73f
parent: 15fa60f37a1aa5324f5760e0a4ae725a113faaa5
author: Erik de Castro Lopo <erikd@mega-nerd.com>
date: Sat Jul 7 05:16:04 EDT 2007

Use HAVE_SIGGALRM and add empty main function if it doesn't exist.

--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2007-07-07  Erik de Castro Lopo  <erikd AT mega-nerd DOT com>
+
+    * acinclude.m4
+    Add AC_CHECK_SIGNAL macro.
+
+    * confiure.ac
+    Use AC_CHECK_SIGNAL to check for SIGALRM.
+
+    * tests/callback_hang_test.c
+    Use HAVE_SIGGALRM and add empty main function if it doesn't exist.
+
 2007-06-15  Erik de Castro Lopo  <erikd AT mega-nerd DOT com>
 
     * src/*_coeffs.h
--- a/tests/callback_hang_test.c
+++ b/tests/callback_hang_test.c
@@ -21,6 +21,8 @@
 #include <unistd.h>
 #include <math.h>
 
+#if HAVE_ALARM && HAVE_SIGNAL && HAVE_SIGALRM
+
 #include <signal.h>
 
 #include <samplerate.h>
@@ -44,7 +46,6 @@
 int
 main (void)
 {
-#if defined (HAVE_ALARM) && defined (HAVE_SIGNAL) && HAVE_ALARM && HAVE_SIGNAL
 	/* Set up SIGALRM handler. */
 	signal (SIGALRM, alarm_handler) ;
 
@@ -53,7 +54,6 @@
 	callback_hang_test (SRC_LINEAR) ;
 	callback_hang_test (SRC_SINC_FASTEST) ;
 	puts ("") ;
-#endif
 
 	return 0 ;
 } /* main */
@@ -106,7 +106,7 @@
 alarm_handler (int number)
 {
 	number = 0 ;
-	printf ("\n\n    Error : Hang inside src_callback_read() detected. Exiting!\n\n");
+	printf ("\n\n    Error : Hang inside src_callback_read() detected. Exiting!\n\n") ;
 	exit (1) ;
 } /* alarm_handler */
 
@@ -121,3 +121,13 @@
 	return ARRAY_LEN (buffer) ;
 } /* input_callback */
 
+#else
+
+int
+main (void)
+{
+	puts ("\tCan't run this test on this platform.") ;
+	return 0 ;
+} /* main */
+
+#endif