build_don_t_redefine_win32_lean_and_mean.patch 1.5 KB

123456789101112131415161718192021222324252627282930313233343536
  1. From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
  2. From: Shelley Vohr <[email protected]>
  3. Date: Fri, 23 Aug 2024 16:50:19 +0200
  4. Subject: build: don't redefine WIN32_LEAN_AND_MEAN
  5. https://github.com/nodejs/node/pull/53722 added a new define for WIN32_LEAN_AND_MEAN
  6. without first checking to see if it was defined - other areas in c-ares do this so
  7. we should here as well. Compilation errors occur otherwise:
  8. ../../third_party/electron_node/deps/cares/include\ares_build.h(168,11): error: 'WIN32_LEAN_AND_MEAN' macro redefined [-Werror,-Wmacro-redefined]
  9. 168 | # define WIN32_LEAN_AND_MEAN
  10. | ^
  11. <command line>(25,9): note: previous definition is here
  12. 25 | #define WIN32_LEAN_AND_MEAN 1
  13. | ^
  14. 1 error generated.
  15. [287 processes, 49437/51449 @ 48.5/s : 1018.562s] CC obj/third_party/electron_node/deps/cares/cares/ares__socket.obj
  16. FAILED: obj/third_party/electron_node/deps/cares/cares/ares__socket.obj
  17. This should be upstreamed.
  18. diff --git a/deps/cares/include/ares_build.h b/deps/cares/include/ares_build.h
  19. index 18a92606a817145302c73b5081b4c989799bc620..bafd26d9210d2347fec41f028e9e65088b83c48c 100644
  20. --- a/deps/cares/include/ares_build.h
  21. +++ b/deps/cares/include/ares_build.h
  22. @@ -165,7 +165,9 @@
  23. # define CARES_TYPEOF_ARES_SOCKLEN_T int
  24. #elif defined(_WIN32)
  25. -# define WIN32_LEAN_AND_MEAN
  26. +# ifndef WIN32_LEAN_AND_MEAN
  27. +# define WIN32_LEAN_AND_MEAN
  28. +# endif
  29. # define CARES_TYPEOF_ARES_SOCKLEN_T int
  30. # define CARES_HAVE_WINDOWS_H 1
  31. # define CARES_HAVE_SYS_TYPES_H 1