Bug 1590861 - Silence WIN32_LEAN_AND_MEAN redefinition warnings in LDAP on Windows. r=me
authorJorg K <jorgk@jorgk.com>
Wed, 23 Oct 2019 23:08:51 +0200
changeset 37341 f9bce47ae978a422b940a95b3e8740ae47524acd
parent 37340 6e38217c8fd63f3e65f168a2462b79b7f3b91454
child 37342 5624874a8354ef03d18052ed3901cba7fd18cb44
push id396
push userclokep@gmail.com
push dateMon, 06 Jan 2020 23:11:57 +0000
reviewersme
bugs1590861
Bug 1590861 - Silence WIN32_LEAN_AND_MEAN redefinition warnings in LDAP on Windows. r=me
ldap/c-sdk/libraries/liblber/lber-int.h
ldap/c-sdk/libraries/libldap/ldap-int.h
--- a/ldap/c-sdk/libraries/liblber/lber-int.h
+++ b/ldap/c-sdk/libraries/liblber/lber-int.h
@@ -68,17 +68,19 @@ extern "C" {
 #    include <malloc.h>
 #  endif
 #  include <errno.h>
 #  include <sys/types.h>
 #  if defined(SUNOS4) || defined(SCOOS)
 #    include <sys/time.h>
 #  endif
 #  if defined(_WINDOWS)
-#    define WIN32_LEAN_AND_MEAN
+#    if !defined(WIN32_LEAN_AND_MEAN)
+#      define WIN32_LEAN_AND_MEAN
+#    endif
 #    include <windows.h>
 #    include <basetsd.h>
 #    define ssize_t SSIZE_T
 #    include <time.h>
 /* No stderr in a 16-bit Windows DLL */
 #    if defined(_WINDLL) && !defined(_WIN32)
 #      define USE_DBG_WIN
 #    endif
--- a/ldap/c-sdk/libraries/libldap/ldap-int.h
+++ b/ldap/c-sdk/libraries/libldap/ldap-int.h
@@ -44,17 +44,19 @@
 #include <time.h>
 #include <fcntl.h>
 #ifdef hpux
 #  include <strings.h>
 #endif /* hpux */
 
 #ifdef _WINDOWS
 #  define FD_SETSIZE 256 /* number of connections we support */
-#  define WIN32_LEAN_AND_MEAN
+#  if !defined(WIN32_LEAN_AND_MEAN)
+#    define WIN32_LEAN_AND_MEAN
+#  endif
 #  include <windows.h>
 #elif defined(macintosh)
 #  include "ldap-macos.h"
 #else /* _WINDOWS */
 #  include <sys/time.h>
 #  include <sys/types.h>
 #  include <sys/socket.h>
 #  include <netinet/in.h>