prometheus-windows-pollfd.patch 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. Target an older version of Windows SDK so that we don't get a conflicting definition of struct pollfd
  2. Windows Vista and later SDKs define struct pollfd for WSAPoll(), but it has a permanent bug:
  3. - https://curl.haxx.se/mail/lib-2012-08/0014.html
  4. - https://curl.haxx.se/mail/lib-2012-10/0038.html
  5. civetweb provides its own implementation of poll, but it has a conflicting definition for pollfd.
  6. Hence we block Windows from defining pollfd (which this project doesn't use).
  7. ---
  8. bazel/civetweb.BUILD | 7 +++++++
  9. 1 file changed, 7 insertions(+)
  10. diff --git bazel/civetweb.BUILD bazel/civetweb.BUILD
  11. --- bazel/civetweb.BUILD
  12. +++ bazel/civetweb.BUILD
  13. @@ -9,6 +9,11 @@ config_setting(
  14. values = {"cpu": "darwin_x86_64"},
  15. )
  16. +config_setting(
  17. + name = "darwin_arm64",
  18. + values = {"cpu": "darwin_arm64"},
  19. +)
  20. +
  21. config_setting(
  22. name = "windows",
  23. values = { "cpu": "x64_windows" },
  24. @@ -34,6 +39,7 @@ cc_library(
  25. "-DNO_CACHING",
  26. "-DNO_SSL",
  27. "-DNO_FILES",
  28. + "-D_WIN32_WINNT=0x0502",
  29. "-UDEBUG",
  30. ],
  31. includes = [
  32. @@ -46,6 +52,7 @@ cc_library(
  33. }) + select({
  34. ":darwin": [],
  35. ":darwin_x86_64": [],
  36. + ":darwin_arm64": [],
  37. ":windows": [],
  38. ":windows_msvc": [],
  39. "//conditions:default": ["-lrt"],
  40. @@ -86,6 +93,7 @@ cc_library(
  41. }) + select({
  42. ":darwin": [],
  43. ":darwin_x86_64": [],
  44. + ":darwin_arm64": [],
  45. ":windows": [],
  46. ":windows_msvc": [],
  47. "//conditions:default": ["-lrt"],
  48. --