Alex Burger wrote:Hi Andy. Andy Smith wrote:Alex Burger wrote:
I think it's time to add an MSVC define so we can easily tell the difference between cygwin, mingw and MSVC as all three define WIN32.
I would be more inclined to do something like a WIN32_SDK. For the most part MSVC and MinGW should compile the same code with few exceptions. The idea behind MinGW is a native Windows port of gcc without the POSIX wrappers of Cygwin.
5.2.1 and later have a HAVE_WIN32_PLATFORM_SDK define in net-snmp-config.h. I added this because it was not possible to compile without the SDK after some new code was added to the 5.2 line.
I wonder if this has anything to do with the MinGW build problems. I think I would have tested it when I implemented, but that would have been with 5.2.1 pre1. HAVE_WIN32_PLATFORM_SDK should be defined for MinGW and Cygwin.
I was able to compile main under both Cygwin and MinGW (with the change mentioned in my previous email for MinGW) without having to define HAVE_WIN32_PLATFORM_SDK.
Not unconditionally, but they can be if the platform SDK is installed.
I take back my suggestion to force HAVE_WIN32_PLATFORM_SDK for MinGW and Cygwin. Even though they both implement some (or maybe even most) of what the real PSDK offers, it's not the same thing.
The files that use 'HAVE_WIN32_PLATFORM_SDK' are system_mib.c, mib_module_includes.h and mib_module_inits.h. These should be changed to check for HAVE_WIN32_PLATFORM_SDK or mingw or cygwin instead as they don't require the real PSDK under mingw or cygwin. I will take care of that and test it.
Alex
The idea of a MSVC define is to be able to identify MSVC without having to say 'WIN32 but not Cygwin and not MinGW'. I did that in the pass_persist patch because I didn't want to affect MinGW or Cygwin, as I couldn't test them because they would not compile. I didn't want to make it worse.. :)
In most (not all...that would be easy) cases code that will compile with MSVC will compile with MinGW. More and more of the Windows API is being implemented there. Keeping Cygwin separate in most cases still makes sense because a lot of POSIX code will compile out of the box with Cygwin. Those are just some things to keep in mind. I will take a stab at fixing MinGW builds soon (hopefully tonight).
Regards, Andy
------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Net-snmp-coders mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
