[Date Prev][Date Next] [Chronological] [Thread] [Top]

(ITS#8695) _sleep is deprecated



Full_Name: Quanah Gibson-Mount
Version: 2.4.45
OS: Windows 10 64-bit
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (47.208.148.239)


When building OpenLDAP, we find:

C:/msys64/home/build/sold-master/openldap/tests/progs/slapd-read.c: In function
'do_read':
C:/msys64/home/build/sold-master/openldap/tests/progs/slapd-read.c:384:11:
warning: '_sleep' is deprecated [-Wdeprecated-declarations]
           sleep( delay );
           ^~~~~
In file included from
C:/msys64/home/build/sold-master/openldap/include/ac/stdlib.h:26:0,
                 from
C:/msys64/home/build/sold-master/openldap/tests/progs/slapd-read.c:24:
C:/msys64/mingw64/x86_64-w64-mingw32/include/stdlib.h:613:24: note: declared
here
   _CRTIMP void __cdecl _sleep(unsigned long _Duration)
__MINGW_ATTRIB_DEPRECATED;
                        ^~~~~~

This comes from:

include/ac/unistd.h

The correct function call is Sleep

#ifdef _WIN32
#define sleep Sleep
#endif

should resolve it.