Patch to guard #define WIN32_LEAN_AND_MEAN

Joel Hockey <[email protected]>
Newsgroups gmane.comp.gnome.lib.xml.general
Message-ID <CAJJNyZbZj7FpxS4aVbhEE1Bf7SVHHtcambWN3NC00iQq7oTThw@mail.gmail.com>
I'm having errors in chromium doing a rollup to the latest code.
https://logs.chromium.org/v/?s=chromium%2Fbb%2Ftryserver.chromium.win%2Fwin7_chromium_rel_ng%2F39058%2F%2B%2Frecipes%2Fsteps%2Fcompile__with_patch_%2F0%2Fstdout

The error I get is because we already have WIN32_LEAN_AND_MEAN defined.
The attached patch guards the definition.

 #if defined(_WIN32) && !defined(__CYGWIN__)
+#ifndef WIN32_LEAN_AND_MEAN
 #define WIN32_LEAN_AND_MEAN
+#endif
 #include <windows.h>
 #endif

An alternative is:

 #if defined(_WIN32) && !defined(__CYGWIN__) &&
!defined(WIN32_LEAN_AND_MEAN)
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #endif

Or feel free to use any other solution.

_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
[email protected]
https://mail.gnome.org/mailman/listinfo/xml
0001-Check-if-WIN32_LEAN_AND_MEAN-is-already-defined.-Hel.patch (application/octet-stream, 590 B)
From f00687e81736a35772cec42b2ba0a47af3375a51 Mon Sep 17 00:00:00 2001
From: Joel Hockey <[email protected]>
Date: Wed, 8 Nov 2017 21:18:37 -0800
Subject: [PATCH] Check if WIN32_LEAN_AND_MEAN is already defined.  Helpful for
 chromium.

---
 xmlIO.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xmlIO.c b/xmlIO.c
index 0fd8c496..5ff83123 100644
--- a/xmlIO.c
+++ b/xmlIO.c
@@ -41,7 +41,9 @@
 #endif
 
 #if defined(_WIN32) && !defined(__CYGWIN__)
+#ifndef WIN32_LEAN_AND_MEAN
 #define WIN32_LEAN_AND_MEAN
+#endif
 #include <windows.h>
 #endif
 
-- 
2.15.0.448.gf294e3d99a-goog
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.