asio
asio copied to clipboard
CYGWIN can define ASIO_WINDOWS.
If you look into all sources that have at least a test on __CYGWIN__
macro, you will see that there is always ASIO_WINDOWS
too.
So, I'm wondering what you will think about doing this change:
- Remove all tests on
__CYGWIN__
from the sources except from:
asio\include\asio\detail\pop_options.hpp
asio\include\asio\detail\push_options.hpp
just because here it is used for a different purpose.
- into
asio\include\asio\detail\config.hpp
, you can remove again__CYGWIN__
and add something like this:
diff --git a/asio/include/asio/detail/config.hpp b/asio/include/asio/detail/config.hpp
index abe264fb..01703562 100644
--- a/asio/include/asio/detail/config.hpp
+++ b/asio/include/asio/detail/config.hpp
@@ -1364,6 +1364,8 @@
# define ASIO_WINDOWS 1
# elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
# define ASIO_WINDOWS 1
+# elif defined(__CYGWIN__) && !defined(ASIO_CYGWIN)
+# define ASIO_WINDOWS 1
# elif defined(ASIO_WINDOWS_APP)
# define ASIO_WINDOWS 1
# endif // defined(ASIO_HAS_BOOST_CONFIG) && defined(BOOST_WINDOWS)
When compiling under CYGWIN, it will work exactly like now and, by defining ASIO_CYGWIN
into the CFLAGS or on the command line, the user can decide which socket implementation to use, if W32_SOCKETS or the sockets provided by the POSIX layer.
I had to do this with my port of Codelite for CYGWIN since it didn't like to mix several POSIX include files with Windows.h
and it made ASIO working immediately with 64bit version of CYGWIN.
If you think that it could be an useful change, I can provide a PR.
Sincerely.
Hope this will finally fix Cygwin 64bit compilation issue - https://github.com/chriskohlhoff/asio/issues/518
@carlo-bramini could you please make a PR for Cygwin 64bit?