Daniel Jacobowitz wrote: > The failing command is trying to compile the PCH. This means that > we're including a large number of libstdc++ headers in a row. One of > the first ones pulls in c++config.h, which has #undef max; but so far, > nothing has included <windows.h>. Later, something includes > gthr-default.h; on this platform that pulls in <windows.h>, which > eventually #define's min. Then later we get <limits>, which now sees > the definition.
Wouldn't the cleanest way to handle this just be to make it a policy that any header that #includes windows.h must either first #define NOMINMAX or immediately #undef min and max afterward? If gthr-default.h gets it via config/gthr-win32.h then it seems it would be simple to just do this at the two places where that file includes windows.h. > Hmm, there are three <ctype.h>'s in the src repository: > > /space/fsf/commit/src/newlib/libc/include/ctype.h > /space/fsf/commit/src/winsup/cygwin/include/ctype.h > /space/fsf/commit/src/winsup/mingw/include/ctype.h > > That third one does not define _U. It uses _UPPER instead. Does this > mean --with-newlib does not work for mingw32? (Note, you can't build > without it either.) Well MinGW doesn't use any part of newlib so using --with-newlib sounds like it's technically incorrect. The right way is probably to add something that does the equivalent of --with-headers=$top_srcdir/winsup/mingw/include (and also --with-libs?) if it detects the $target mingw* and a combined tree. I think there is something similar to this already present for using winsup/cygwin in a combined tree. Brian