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
          |           ^
    <command line>(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)
pull/870/head
Shelley Vohr 3 months ago committed by GitHub
parent 9e9bd1f516
commit d2681a8f41
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      include/ares_build.h.dist

@ -165,7 +165,6 @@
# define CARES_TYPEOF_ARES_SOCKLEN_T int # define CARES_TYPEOF_ARES_SOCKLEN_T int
#elif defined(_WIN32) #elif defined(_WIN32)
# define WIN32_LEAN_AND_MEAN
# define CARES_TYPEOF_ARES_SOCKLEN_T int # define CARES_TYPEOF_ARES_SOCKLEN_T int
# define CARES_HAVE_WINDOWS_H 1 # define CARES_HAVE_WINDOWS_H 1
# define CARES_HAVE_SYS_TYPES_H 1 # define CARES_HAVE_SYS_TYPES_H 1

Loading…
Cancel
Save