mingw.patch 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. From 241c24cb038770d0c9b499fea8ae1e6df5d170a4 Mon Sep 17 00:00:00 2001
  2. From: Stephan Lachnit <[email protected]>
  3. Date: Tue, 23 Apr 2024 16:02:59 +0200
  4. Subject: [PATCH] Do not use _MSC_VER if windows
  5. This fixes several instances where _MSC_VER was used to determine whether to use afunix.h or not. For example, MinGW requires the use of afunix.h but does not define _MSC_VER. The correct behavior is checking ZMQ_HAVE_WINDOWS.
  6. Signed-off-by: Stephan Lachnit <[email protected]>
  7. ---
  8. src/ipc_address.hpp | 2 +-
  9. src/ipc_connecter.cpp | 2 +-
  10. src/ipc_listener.cpp | 2 +-
  11. tests/testutil.cpp | 2 +-
  12. 4 files changed, 4 insertions(+), 4 deletions(-)
  13. diff --git a/src/ipc_address.hpp b/src/ipc_address.hpp
  14. index 422c271127..87f1245b1b 100644
  15. --- a/src/ipc_address.hpp
  16. +++ b/src/ipc_address.hpp
  17. @@ -7,7 +7,7 @@
  18. #include <string>
  19. -#if defined _MSC_VER
  20. +#if defined ZMQ_HAVE_WINDOWS
  21. #include <afunix.h>
  22. #else
  23. #include <sys/socket.h>
  24. diff --git a/src/ipc_connecter.cpp b/src/ipc_connecter.cpp
  25. index 3f988745e7..ed2a0645ab 100644
  26. --- a/src/ipc_connecter.cpp
  27. +++ b/src/ipc_connecter.cpp
  28. @@ -16,7 +16,7 @@
  29. #include "ipc_address.hpp"
  30. #include "session_base.hpp"
  31. -#ifdef _MSC_VER
  32. +#if defined ZMQ_HAVE_WINDOWS
  33. #include <afunix.h>
  34. #else
  35. #include <unistd.h>
  36. diff --git a/src/ipc_listener.cpp b/src/ipc_listener.cpp
  37. index 586bd7641c..92293da792 100644
  38. --- a/src/ipc_listener.cpp
  39. +++ b/src/ipc_listener.cpp
  40. @@ -17,7 +17,7 @@
  41. #include "socket_base.hpp"
  42. #include "address.hpp"
  43. -#ifdef _MSC_VER
  44. +#ifdef ZMQ_HAVE_WINDOWS
  45. #ifdef ZMQ_IOTHREAD_POLLER_USE_SELECT
  46. #error On Windows, IPC does not work with POLLER=select, use POLLER=epoll instead, or disable IPC transport
  47. #endif
  48. diff --git a/tests/testutil.cpp b/tests/testutil.cpp
  49. index bdc80283cb..6f21e8f608 100644
  50. --- a/tests/testutil.cpp
  51. +++ b/tests/testutil.cpp
  52. @@ -7,7 +7,7 @@
  53. #if defined _WIN32
  54. #include "../src/windows.hpp"
  55. -#if defined _MSC_VER
  56. +#if defined ZMQ_HAVE_WINDOWS
  57. #if defined ZMQ_HAVE_IPC
  58. #include <direct.h>
  59. #include <afunix.h>