On Jun 28 16:01, Kai Tietz wrote: > 2012/6/28 Corinna Vinschen <[email protected]>: > > No worries. Something else occured to me a couple of minutes ago. The > > #ifndef FD_xxx guards don't make much sense right now. After all, they > > are undef'ed anyway in winsock2.h since psdk_inc/_ws1_undef.h is > > included unconditionally. > > > > This means that any other set of FD_xxx macro definitions are > > overwritten with the winsock2.h version if winsock2.h is accidentally > > included after the other definitions of FD_xxx. > > > > That worries me a bit. I can't lay my hand on an example yet, but it > > will probably show up sooner or later. > > > > So, here's my question. What if the #undef of the FD_xxx macros in > > _ws1_undef.h are actually removed, as you proposed originally, and the > > entire mechanism is moved into _fd_types.h: > > The issue is that we need to provide upgrade of wsock 1 to wsock 2. > This issue was caused by w32api headers, which are using winsock2 by > default in windows.h header. For mingw-w64 this isn't true. > By this mingw.org users are custom to use the following code: > #include <windows.h> > #include <winsock2.h> > > which would then of course would cause a redefinition-failure for us.
Not if we use the below preprocessor expression. > So we allow to redefine and upgrade. > > > #if defined(FD_CLEAR) && defined(_FD_CLEAR_WINSOCK_DEFINED) > > #undef FD_CLEAR > > #endif /* FD_CLEAR && _FD_CLEAR_WINSOCK_DEFINED */ > > #ifndef FD_CLEAR > > #define FD_CLEAR ... > > #ifndef _WINSOCK2API_ /* Testing for _WINSOCKAPI_ isn't safe. */ > > #define _FD_CLEAR_WINSOCK_DEFINED > > #endif /* !_WINSOCK2API_ */ > > #endif /* !FD_CLEAR */ > > > > Alternatively we ignore the problem for now and wait calmly for a > > problem to show up. What's your stance? > > > >> (My only concerns were for the FD_* stuff. For the rest, others review > >> please.) > > > > Kai? > > > > > > Thanks, > > Corinna > > So I see current behavior ok. Only for native builds, but potentially not for Cygwin/native bastard applkations. That's what my proposal is for. The above expression will handle that by undefing FD_CLEAR *only* if it has been defined in winsock.h before, but *not* if FD_CLEAR has been defined elsewhere. Corinna ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
