Reputation: 620
I am porting the Enhanced CTorrent to Windows. But I'd like use Visual Studio to compile source code and get rid of cygwin.dll.
I found directives to conditionally use winsock header. But at moment I only can compile the source code by cygwin. I am wondering is the WINDOWS in code below same as _WIN32 in Visual Studio? And can cygwin directly use Win32 API as well?
#ifdef WINDOWS
#include <Winsock2.h>
#else
Upvotes: 0
Views: 272
Reputation: 26171
if you still want to keep this working under cygwin while you convert the source, you can use something like:
#if defined(WINDOWS) || defined(_WIN32)
#include <Winsock2.h>
#else
and for using Win32 API on cygwin, see the FAQ.
Upvotes: 2