Skip to content

Commit

Permalink
[boost] Add UNIX domain sockets support for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
huangqinjin committed Aug 4, 2020
1 parent 1baf047 commit b87450d
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions include/minapp/fwd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,27 @@
#include <boost/asio/generic/stream_protocol.hpp>
#include <boost/asio/io_context.hpp>


// Windows does not support abstract unix domain sockets yet.
// https://github.com/microsoft/WSL/issues/4240
// https://github.com/boostorg/asio/pull/311
// UNIX domain sockets.
#if !defined(BOOST_ASIO_HAS_LOCAL_SOCKETS)
# if !defined(BOOST_ASIO_DISABLE_LOCAL_SOCKETS)
# if !defined(BOOST_ASIO_WINDOWS_RUNTIME)
# define BOOST_ASIO_HAS_LOCAL_SOCKETS 1
# endif // !defined(BOOST_ASIO_WINDOWS_RUNTIME)
# endif // !defined(BOOST_ASIO_DISABLE_LOCAL_SOCKETS)
#endif // !defined(BOOST_ASIO_HAS_LOCAL_SOCKETS)

#if defined(BOOST_ASIO_WINDOWS) && !defined(BOOST_ASIO_WINDOWS_RUNTIME) || defined(__CYGWIN__)
namespace boost::asio::detail {
struct sockaddr_un_type { unsigned short sun_family;
char sun_path[108]; }; /* copy from afunix.h */
}
#endif


#define MINAPP_EXPORT BOOST_SYMBOL_EXPORT
#define MINAPP_IMPORT BOOST_SYMBOL_IMPORT

Expand Down

0 comments on commit b87450d

Please sign in to comment.