Skip to content

Commit

Permalink
Do not use _MSC_VER if windows
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Stephan Lachnit <[email protected]>
  • Loading branch information
stephanlachnit authored and bluca committed Apr 23, 2024
1 parent 2a75ef0 commit aa885c5
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/ipc_address.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include <string>

#if defined _MSC_VER
#if defined ZMQ_HAVE_WINDOWS
#include <afunix.h>
#else
#include <sys/socket.h>
Expand Down
2 changes: 1 addition & 1 deletion src/ipc_connecter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "ipc_address.hpp"
#include "session_base.hpp"

#ifdef _MSC_VER
#if defined ZMQ_HAVE_WINDOWS
#include <afunix.h>
#else
#include <unistd.h>
Expand Down
2 changes: 1 addition & 1 deletion src/ipc_listener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "socket_base.hpp"
#include "address.hpp"

#ifdef _MSC_VER
#ifdef ZMQ_HAVE_WINDOWS
#ifdef ZMQ_IOTHREAD_POLLER_USE_SELECT
#error On Windows, IPC does not work with POLLER=select, use POLLER=epoll instead, or disable IPC transport
#endif
Expand Down
2 changes: 1 addition & 1 deletion tests/testutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#if defined _WIN32
#include "../src/windows.hpp"
#if defined _MSC_VER
#if defined ZMQ_HAVE_WINDOWS
#if defined ZMQ_HAVE_IPC
#include <direct.h>
#include <afunix.h>
Expand Down

0 comments on commit aa885c5

Please sign in to comment.