Can't get includes untangled

Jarome jamesrome@gmail.com
Tue Jan 10 19:18:00 GMT 2012


When I make my Windows 7 cygwin project, I keep getting
In file included from /usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../
include/w32api/windows.h:98:0,
                 from src/tkfPusher.c:23:
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/
winsock2.h:103:2: warning: #warning "fd_set and associated macros have
been defined in sys/types.      This may cause runtime problems with
W32 sockets"

Everything works in MinGW.

I tried adding the #define __USE_W32_SOCKETS to
try and fix this because if defined, it should ignore the fd things in
types.h, but no success.
So how do I untangle the includes for Cygwin?
The code is:
#define GPC_CYGWIN
#define GPC_WIN
#include <stdio.h>
#include <errno.h>
#include <dirent.h>   // This includes sys/types.h

#ifdef GPC_WIN
#define __USE_W32_SOCKETS
#include <windows.h>
#include <process.h>
#include <time.h>
#ifdef GPC_CYGWIN
// winsoch2.h should be included by windows.h if __USE_W32_SOCKETS is
defined
//#include <w32api/winsock2.h>
#include <w32api/winbase.h>
#include <string.h>
#endif
#ifdef GPC_MINGW
#include <winsock2.h>
#include <winbase.h>
#include <string.h>
#endif

#endif

Thanks for the help,
Jim

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list