From d2681a8f4188f49e7d1aab60b8f7a3fd11da68bc Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Mon, 26 Aug 2024 20:07:04 +0200 Subject: [PATCH] fix: potential `WIN32_LEAN_AND_MEAN` redefinition (#869) For non-cmake/autotools builds WIN32_LEAN_AND_MEAN was being defined in ares_build.h.dist, this can cause conflicts with projects that import c-ares and already define this. The Node.js upgrade to c-ares v1.32.2, causes compilation failures like the following: ``` ../../third_party/electron_node/deps/cares/include\ares_build.h(168,11): err or: 'WIN32_LEAN_AND_MEAN' macro redefined [-Werror,-Wmacro-redefined] 168 | # define WIN32_LEAN_AND_MEAN | ^ (25,9): note: previous definition is here 25 | #define WIN32_LEAN_AND_MEAN 1 | ^ 1 error generated. [287 processes, 49437/51449 @ 48.5/s : 1018.562s] CC obj/third_party/electro n_node/deps/cares/cares/ares__socket.obj FAILED: obj/third_party/electron_node/deps/cares/cares/ares__socket.obj ``` Authored-By: Shelley Vohr (@codebytere) --- include/ares_build.h.dist | 1 - 1 file changed, 1 deletion(-) diff --git a/include/ares_build.h.dist b/include/ares_build.h.dist index 18a92606..aca66beb 100644 --- a/include/ares_build.h.dist +++ b/include/ares_build.h.dist @@ -165,7 +165,6 @@ # define CARES_TYPEOF_ARES_SOCKLEN_T int #elif defined(_WIN32) -# define WIN32_LEAN_AND_MEAN # define CARES_TYPEOF_ARES_SOCKLEN_T int # define CARES_HAVE_WINDOWS_H 1 # define CARES_HAVE_SYS_TYPES_H 1