Before working on MSVC support, the replacement sleep() call
only called assert(). Instead, it was assumed that the related
code would not be called, as the only platform that did not
provide a sleep() call also did not provide fork() (e.g. Windows),
so the related code never got executed.
As we still do not provide a fork(), the sleep() replacement is
unnecessary as it is never called. If, in the future, Check
provides a fork() replacement, then a sleep() replacement will
make sense.
git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@988
64e312b2-a51f-0410-8e61-
82d0ca0eb02a
check_function_exists(realloc HAVE_REALLOC)
check_function_exists(setenv HAVE_DECL_SETENV)
check_function_exists(sigaction HAVE_SIGACTION)
-check_function_exists(sleep HAVE_DECL_SLEEP)
check_function_exists(snprintf HAVE_SNPRINTF)
check_function_exists(strdup HAVE_DECL_STRDUP)
check_function_exists(strerror HAVE_STRERROR)
HW_LIBRT_TIMERS
# The following checks will replace missing functions from libcompat
-AC_REPLACE_FUNCS([alarm clock_gettime gettimeofday localtime_r sleep strdup strsignal])
-AC_CHECK_DECLS([alarm, clock_gettime, gettimeofday, localtime_r, sleep, strdup, strsignal])
+AC_REPLACE_FUNCS([alarm clock_gettime gettimeofday localtime_r strdup strsignal])
+AC_CHECK_DECLS([alarm, clock_gettime, gettimeofday, localtime_r, strdup, strsignal])
# The following checks are to only detect if the functions exist, but
# not replace them
set(SOURCES ${SOURCES} realloc.c)
endif(NOT HAVE_REALLOC)
-if(NOT HAVE_DECL_SLEEP)
- set(SOURCES ${SOURCES} sleep.c)
-endif(NOT HAVE_DECL_SLEEP)
-
if(NOT HAVE_SNPRINTF AND NOT HAVE__SNPRINTF)
set(SOURCES ${SOURCES} snprintf.c)
add_definitions(-Dsnprintf=rpl_snprintf)
#endif
#endif /* !HAVE_DECL_LOCALTIME_R */
-#if !HAVE_DECL_SLEEP
-CK_DLL_EXP unsigned int sleep (unsigned int seconds);
-#endif /* !HAVE_DECL_SLEEP */
-
#if !HAVE_DECL_STRDUP && !HAVE__STRDUP
CK_DLL_EXP char *strdup (const char *str);
#elif !HAVE_DECL_STRDUP && HAVE__STRDUP
+++ /dev/null
-#include "libcompat.h"
-
-#if _MSC_VER
-#include <windows.h> /* Sleep() */
-#endif
-
-unsigned int sleep (unsigned int seconds CK_ATTRIBUTE_UNUSED)
-{
-#if _MSC_VER
- DWORD millisecs = seconds * 1000;
- Sleep(millisecs);
-#else
- assert (0);
-#endif
- return 0;
-}