]> granicus.if.org Git - check/commitdiff
Add alarm() to libcompat for platforms that do not define it
authorbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Sun, 21 Jul 2013 21:06:04 +0000 (21:06 +0000)
committerbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Sun, 21 Jul 2013 21:06:04 +0000 (21:06 +0000)
It was noticed in MinGW that alarm() is not defined. Adding it to
libcompat.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@750 64e312b2-a51f-0410-8e61-82d0ca0eb02a

configure.ac
lib/libcompat.h

index 1a40f05378650b5e6b94b8cf29d13b056b2b61a1..0d8c80d25f73430ac12a2be5ea1366c74dfa1cc3 100644 (file)
@@ -181,8 +181,8 @@ AC_CHECK_SIZEOF(long, 4)
 # Checks for library functions.
 AC_FUNC_MALLOC
 AC_FUNC_REALLOC
-AC_REPLACE_FUNCS([clock_gettime timer_create timer_settime timer_delete fileno localtime_r pipe putenv setenv sleep strdup strsignal unsetenv])
-AC_CHECK_DECLS([clock_gettime, timer_create, timer_settime, timer_delete, fileno, localtime_r, pipe, putenv, setenv, sleep, strdup, strsignal, unsetenv])
+AC_REPLACE_FUNCS([alarm clock_gettime timer_create timer_settime timer_delete fileno localtime_r pipe putenv setenv sleep strdup strsignal unsetenv])
+AC_CHECK_DECLS([alarm, clock_gettime, timer_create, timer_settime, timer_delete, fileno, localtime_r, pipe, putenv, setenv, sleep, strdup, strsignal, unsetenv])
 
 # Check if the system's snprintf (and its variations) are C99 compliant.
 # If they are not, use the version in libcompat.
index b343d2b074fa92908da8d90539e305f01181ffdb..d2c713f9fb23ceffda5682ef7eb4bf76d79a7ad9 100644 (file)
 #endif
 
 /* replacement functions for broken originals */
+#if !HAVE_DECL_ALARM
+unsigned int alarm (unsigned int seconds);
+#endif /* !HAVE_DECL_ALARM */
+
 #if !HAVE_MALLOC
 void *rpl_malloc (size_t n);
 #endif /* !HAVE_MALLOC */