diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt index e6cfc65..01effbf 100644 --- a/crypto/CMakeLists.txt +++ b/crypto/CMakeLists.txt @@ -808,7 +808,6 @@ if(WIN32) set(EXTRA_EXPORT ${EXTRA_EXPORT} posix_write) set(EXTRA_EXPORT ${EXTRA_EXPORT} posix_getsockopt) set(EXTRA_EXPORT ${EXTRA_EXPORT} posix_setsockopt) - set(EXTRA_EXPORT ${EXTRA_EXPORT} sleep) endif() if(NOT HAVE_ASPRINTF) diff --git a/crypto/compat/posix_win.c b/crypto/compat/posix_win.c index 4b4b5f5..30c93cd 100644 --- a/crypto/compat/posix_win.c +++ b/crypto/compat/posix_win.c @@ -242,10 +242,4 @@ int gettimeofday(struct timeval * tp, struct timezone * tzp) return 0; } -unsigned int sleep(unsigned int seconds) -{ - Sleep(seconds * 1000); - return seconds; -} - #endif diff --git a/include/compat/unistd.h b/include/compat/unistd.h index f521b94..4c4df10 100644 --- a/include/compat/unistd.h +++ b/include/compat/unistd.h @@ -37,7 +37,13 @@ ssize_t pwrite(int d, const void *buf, size_t nbytes, off_t offset); #define access _access -unsigned int sleep(unsigned int seconds); +#ifdef _MSC_VER +static inline unsigned int sleep(unsigned int seconds) +{ + Sleep(seconds * 1000); + return seconds; +} +#endif int ftruncate(int fd, off_t length); uid_t getuid(void);