avoid exporting a sleep() symbol from libcrypto
Since it seems only MSVC lacks sleep(), and it's only used by apps, lets special-case that and make it available as a static inline function instead.
This commit is contained in:
parent
ceeb3bb4f4
commit
79f2a52a39
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user