From: Howard Chu Date: Tue, 18 Dec 2001 02:03:23 +0000 (+0000) Subject: Move Windows sleep macro from acconfig.h to ac/unistd.h X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~626 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=276ed0bbae5f9b16646d2f4064ad9ef3da1d1b1a;p=openldap Move Windows sleep macro from acconfig.h to ac/unistd.h --- diff --git a/acconfig.h b/acconfig.h index 7e6de552ee..7da3594d4c 100644 --- a/acconfig.h +++ b/acconfig.h @@ -77,8 +77,6 @@ #ifdef _WIN32 /* don't suck in all of the win32 api */ # define WIN32_LEAN_AND_MEAN 1 - -# define sleep _sleep #endif #ifndef LDAP_NEEDS_PROTOTYPES diff --git a/include/ac/unistd.h b/include/ac/unistd.h index 49236f8265..f92f28f0b1 100644 --- a/include/ac/unistd.h +++ b/include/ac/unistd.h @@ -60,4 +60,15 @@ LDAP_LUTIL_F(char*)(lutil_getpass) LDAP_P((const char *getpass)); #define ldap_unlockf(x) lutil_unlockf(x) #include +/* + * Windows: although sleep() will be resolved by both MSVC and Mingw GCC + * linkers, the function is not declared in header files. This is + * because Windows' version of the function is called _sleep(), and it + * is declared in stdlib.h + */ + +#ifdef _WIN32 +#define sleep _sleep +#endif + #endif /* _AC_UNISTD_H */