From c37fa6d165421fa0640ae3a87d368f56c9f0eab9 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Mon, 17 Dec 2001 22:40:10 +0000 Subject: [PATCH] from jon@symas.com - misc MSVC cleanup --- include/ac/string.h | 4 +++- include/ac/unistd.h | 6 ------ include/lutil.h | 8 +++++++- include/queue-compat.h | 5 +++++ 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/include/ac/string.h b/include/ac/string.h index 24fd966557..0b35663835 100644 --- a/include/ac/string.h +++ b/include/ac/string.h @@ -62,9 +62,11 @@ LDAP_F(char *) ldap_pvt_strtok LDAP_P(( char *str, * we need them declared so we can obtain pointers to them */ -/* In Mingw32, strcasecmp is not in the C library, so we don't LIBC_F it */ +/* we don't want these declared for Windows or Mingw */ +#ifndef _WIN32 int (strcasecmp)(); int (strncasecmp)(); +#endif #ifndef SAFEMEMCPY # if defined( HAVE_MEMMOVE ) diff --git a/include/ac/unistd.h b/include/ac/unistd.h index daa413a15f..49236f8265 100644 --- a/include/ac/unistd.h +++ b/include/ac/unistd.h @@ -55,12 +55,6 @@ LDAP_LUTIL_F(char*)(lutil_getpass) LDAP_P((const char *getpass)); LDAP_LIBC_V (int) optind, opterr, optopt; #endif -#ifndef HAVE_TEMPNAM - LDAP_LUTIL_F(char *)(tempnam) LDAP_P(( - const char *tmpdir, - const char *prefix)); -#endif - /* use lutil file locking */ #define ldap_lockf(x) lutil_lockf(x) #define ldap_unlockf(x) lutil_unlockf(x) diff --git a/include/lutil.h b/include/lutil.h index b5f038be5e..1ebba1b466 100644 --- a/include/lutil.h +++ b/include/lutil.h @@ -106,6 +106,11 @@ lutil_progname LDAP_P(( int argc, char *argv[] )); +#ifndef HAVE_MKSTEMP +LDAP_LUTIL_F( int ) +mkstemp LDAP_P (( char * template )); +#endif + /* sockpair.c */ LDAP_LUTIL_F( int ) lutil_pair( ber_socket_t sd[2] ); @@ -132,7 +137,8 @@ LDAP_LUTIL_V (int) is_NT_Service; LDAP_LUTIL_V (ldap_pvt_thread_cond_t) started_event; #endif /* _LDAP_PVT_THREAD_H */ -#ifdef _WINSVC_H +/* macros are different between Windows and Mingw */ +#if defined(_WINSVC_H) || defined(_WINSVC_) LDAP_LUTIL_V (SERVICE_STATUS) SLAPDServiceStatus; LDAP_LUTIL_V (SERVICE_STATUS_HANDLE) hSLAPDServiceStatus; #endif /* _WINSVC_H */ diff --git a/include/queue-compat.h b/include/queue-compat.h index 41e06e462a..4a771c5a3e 100644 --- a/include/queue-compat.h +++ b/include/queue-compat.h @@ -122,6 +122,11 @@ * see queue(3) for instructions on how to use */ +/* The latest set of Windows headers defines SLIST_ENTRY in WINNT.H */ +#ifdef SLIST_ENTRY +#undef SLIST_ENTRY +#endif + /* * Singly-linked List definitions. */ -- 2.39.5