I've applied patches 1, 3, and 4. I need to investigate 2 a little bit more. One of the first things winsock.h does is pull in windows.h.
Can you point me to the recommendation? ----- Rom -----Original Message----- From: boinc_dev [mailto:[email protected]] On Behalf Of Timo Strunk Sent: Monday, April 28, 2014 12:34 PM To: [email protected] Subject: [boinc_dev] [PATCH] MinGW lib build currently broken Hi everybody, The commit afb6dcc6f3166f004327ec6fe32f39c577b40b38 "MGR & Client: Massive code clean-up. Remove as much of the LoadLibrary[...]" breaks MinGW compilation because of the line #include <winternl.h> The stock MinGW distribution does not carry this include, but the newer MinGW-W64(http://sourceforge.net/apps/trac/mingw-w64/browser/trunk/mingw -w64-headers/include/winternl.h?rev=5224), does. However also here the compilation fails with the commit. We (Thomas Koch and me) therefore tried fixing this situation for MinGW-W64: The problem is simply that MinGW-W64's winternl.h defines another THREAD_STATE enum (also in diagnostics_win.h), which is similar to the one of the BOINC lib, but has members, which carry different names. The reason this is possible, is that there is no official THREAD_STATE enum; Microsoft's implementation is a simple DWORD and some #defines for the STATEs. (I'm definitely no expert on this, so I might be completely wrong. I did not find any _official_ THREAD_STATE definition). 1.) As I think it will be really hard to change the naming of the MinGW compiler, the attached patch changes the naming in the BOINC library and does not define the enums in case of __MINGW32__ defines, as it relies on the ones found in winternl.h. In this way we don't change functionality in case of MSVC compiles (please test, I only checked MinGW), but still allow compilation with MinGW-W64. Another occurence happens in the installer directory, but I did not touch this, because I think it's not intended to be MinGW compatible anyways. These are: 0001-Renamed-Thread_State-enum-names-to-mingw-standard-in.patch 0003-Renamed-StateWaiting-again-to-StateWait-as-per-mingw.patch 2.) The attached patches also include <delayimp.h> for MinGW, as it seems to be required nowadays. 0004-MinGW-also-requires-delayimp-now.patch This patch here is not required for making everything compile: 3.) winsock.h is now included prior to windows.h as recommended. Also WIN32_LEAN_AND_MEAN is defined, because I saw no reason not to. If it is defined somewhere else or even required to be absent and I didn't notice, please remove it. It might not be good style to define it just like that in a header. 0002-Include-winsock-before-windows.h.patch With these 4 patches, mingw still doesn't compile using the supplied makefile, but requires -fpermissive to be set. The reasons are multiple deprecated string conversions. After the commit mentioned at the beginning of the mail Windows 2000 support was dropped for the lib. Maybe the switch to Winsock2.h (Win98 and NT4 and upwards) and ws2tcpip.h (ipv6) should also be made now as the code still seems to use winsock.h and it should be a simple change of one include. However: Again, I'm no expert on the subject and there might be good legacy reasons to keep everything as is. Best, Timo _______________________________________________ boinc_dev mailing list [email protected] http://lists.ssl.berkeley.edu/mailman/listinfo/boinc_dev To unsubscribe, visit the above URL and (near bottom of page) enter your email address.
