Summary: | Cannot compile project on Windows SDK 6.0 (Vista), compiling errors in network _io\unix\multicast.c | ||
---|---|---|---|
Product: | APR | Reporter: | sheldon robinson <sheldon.robinson> |
Component: | APR | Assignee: | Apache Portable Runtime bugs mailinglist <bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | sander |
Priority: | P2 | ||
Version: | 1.2.7 | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Windows Vista | ||
Attachments: |
enable IPv6+mcast groups
Dirtier of two solutions; enable IPv6 + mcast source groups Cleaner of two solutions; enable IPv6 + mcast source groups |
Description
sheldon robinson
2006-09-02 16:51:55 UTC
I'm not seeing this, so I'll presume it's fixed? Reopen with much more detail if you still have issues. I have the same problem with Windows SDK 6.0. I found a workaround solution at http://procfs.blogspot.com/2007/02/build-apache-on-vista.html. After more investigating on the issue I figured out that Windows SDK 6.0 introduces the new macro MCAST_JOIN_SOURCE_GROUP and that's the reason of the error messages. --- ws2ipdef.h -------- 651: #define MCAST_JOIN_SOURCE_GROUP 45 // Join IP group/source. 748: #if (NTDDI_VERSION >= NTDDI_WINXP) 762: typedef struct group_source_req { 783: #endif Clearly that in some cases, if the macro MCAST_JOIN_SOURCE_GROUP is defined, struct group_source_req is not defined (because #if). On Linux (http://lxr.oss.org.cn/source/include/linux/in.h), there is no #if (NTDDI_VERSION >= NTDDI_WINXP) like that. So I think if we change the code of multicast.c from 136: #if MCAST_JOIN_SOURCE_GROUP 148: #if MCAST_JOIN_SOURCE_GROUP to 136: #if defined(group_source_req) 148: #if defined(group_source_req) the error will be resolved. I have updated the file multicast.c and it fixed the issue on my machine (Windows XP, VS2005, Windows SDK 6.0) Created attachment 20330 This test shouldn't work #if defined(group_source_req) because it's a struct not a #define. We can do a HAVE_GROUP_SOURCE_REQ from autoconf, and in the win32 case simply define it as '1' in our prepared flavor of the .h.in headers we name .hw. I'll investigate this, but in the meantime DO NOT VIOLATE COPYRIGHTS by republishing copyrighted documents in violation of whatever license or lack thereof you have. The attachment has been purged, please don't make us do this again. Created attachment 21318 [details]
enable IPv6+mcast groups
Summary;
This moronic tangle of defintions and dependencies from the world according to
the win32 api in SDK versions 6.0 and later; it unconditionally declares
MCAST_JOIN_SOURCE_GROUP, while it declares group_source_req etc only for
_WIN32_WINNT_WINXP and later. Testing defined(GROUP_FILTER_SIZE) instead of
MCAST_JOIN_SOURCE_GROUP within multicast.c would solve this connundrum.
The alternative of defining _WIN32_WINNT as _WIN32_WINNT_WINXP does solve,
but need to confirm this doesn't have a side effect of breaking win2k etc.
A patch is attached
Comment on attachment 21318 [details]
enable IPv6+mcast groups
Replacing...
Created attachment 21319 [details]
Dirtier of two solutions; enable IPv6 + mcast source groups
Here's an updated patch (to trunk) with cleaner lineends which will compile
on pre-XP SDK's.
Created attachment 21320 [details]
Cleaner of two solutions; enable IPv6 + mcast source groups
According to linux and win32 this may be a sufficiently portable alternative
to the dirty-patch. Win32 defines this macro (unlike the MCAST_ macro group)
only for WinXP sdk level.
Fixed for APR 1.2.13, the cleaner of the two patches was applied. |