From: brarcher Date: Sun, 21 Jul 2013 21:06:04 +0000 (+0000) Subject: Add alarm() to libcompat for platforms that do not define it X-Git-Tag: 0.10.0~464 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=28f4e378381fbc464c46f2da213a0614a5da2071;p=check Add alarm() to libcompat for platforms that do not define it 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 --- diff --git a/configure.ac b/configure.ac index 1a40f05..0d8c80d 100644 --- a/configure.ac +++ b/configure.ac @@ -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. diff --git a/lib/libcompat.h b/lib/libcompat.h index b343d2b..d2c713f 100644 --- a/lib/libcompat.h +++ b/lib/libcompat.h @@ -50,6 +50,10 @@ #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 */