From 79f2a52a391dab35132a2aa998757abea7f32533 Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Tue, 14 Apr 2020 22:29:37 -0500 Subject: 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. --- include/compat/unistd.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'include') 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); -- cgit v1.2.3-55-g6feb