libs: Import code from upstream openldap 2.5.13.
[wine.git] / libs / ldap / include / ac / unistd.h
blobd9c4529aa0131ad035afd87b5cf64a87e4539eb9
1 /* Generic unistd.h */
2 /* $OpenLDAP$ */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 * Copyright 1998-2022 The OpenLDAP Foundation.
6 * All rights reserved.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted only as authorized by the OpenLDAP
10 * Public License.
12 * A copy of this license is available in file LICENSE in the
13 * top-level directory of the distribution or, alternatively, at
14 * <http://www.OpenLDAP.org/license.html>.
17 #ifndef _AC_UNISTD_H
18 #define _AC_UNISTD_H
20 #ifdef HAVE_SYS_TYPES_H
21 # include <sys/types.h>
22 #endif
24 #ifdef HAVE_UNISTD_H
25 # include <unistd.h>
26 #endif
28 #ifdef HAVE_PROCESS_H
29 # include <process.h>
30 #endif
32 /* note: callers of crypt(3) should include <ac/crypt.h> */
34 #if defined(HAVE_GETPASSPHRASE)
35 LDAP_LIBC_F(char*)(getpassphrase)();
37 #else
38 #define getpassphrase(p) lutil_getpass(p)
39 LDAP_LUTIL_F(char*)(lutil_getpass) LDAP_P((const char *getpass));
40 #endif
42 /* getopt() defines may be in separate include file */
43 #ifdef HAVE_GETOPT_H
44 # include <getopt.h>
46 #elif !defined(HAVE_GETOPT)
47 /* no getopt, assume we need getopt-compat.h */
48 # include <getopt-compat.h>
50 #else
51 /* assume we need to declare these externs */
52 LDAP_LIBC_V (char *) optarg;
53 LDAP_LIBC_V (int) optind, opterr, optopt;
54 #endif
56 /* use lutil file locking */
57 #define ldap_lockf(x) lutil_lockf(x)
58 #define ldap_unlockf(x) lutil_unlockf(x)
59 #include <lutil_lockf.h>
62 * Windows: although sleep() will be resolved by both MSVC and Mingw GCC
63 * linkers, the function is not declared in header files. This is
64 * because Windows' version of the function is called _sleep(), and it
65 * is declared in stdlib.h
68 #ifdef _WIN32
69 #define sleep _sleep
70 #endif
72 #endif /* _AC_UNISTD_H */