[cfe-dev] MinGW(-w64) fixes to InitHeaderSearch.cpp and float.h

Ruben Van Boxem vanboxem.ruben at gmail.com
Sat Jun 25 07:51:42 PDT 2011


Hi,

I bring fixes for MinGW(-w64) Clang users:

1. InitHeaderSearch.cpp: add a HeaderSearchOptions argument to
AddDefaultCXXIncludePaths (AddDefaultCIncludePaths already had this,
seems only logical to have it here) and use ResourceDir to find the
sysroot of where Clang.exe is located. From there, add the
x86_64-w64-mingw32 and i686-w64-mingw32 include paths for C and C++.
All mingw-w64 toolchains are built --with-sysroot, and thus
relocatable, so this change will always find the accompanying headers.

2. float.h: MinGW needs an #include_next, because as described on this
page (http://msdn.microsoft.com/en-us/library/y0ybw9fy.aspx) there are
non-standard extensions to float.h which are expected on Windows, and
MinGW provides these declarations in their system header. GCC's
float.h is "fixinclude"d to include_next the system header. Note that
a trivial change is needed in mingw-w64's float.h, and that change
will be committed as soon as Clang's header does what it's supposed to
do.

I do not have commit access, so if someone would please commit these
changes, Clang will become a nicer MinGW compiler, and I would very
much appreciate it. There are still lots of problems though, but this
will make a basic setup work at least for trivial programs.

Thanks!

Ruben



More information about the cfe-dev mailing list