[cfe-dev] Including windows.h, include paths

John Thompson john.thompson.jtsoftware at gmail.com
Wed Oct 7 21:35:56 PDT 2009


I was taking a crack at modifying Frontend/InitHeaderSearch.cpp to use the
Windows registry to find the Visual Studio installation directory, but find
that because of the /Za option used via cmake (disables Microsoft extensions
- ANSI only), windows.h won't compile.

As an experiment I took out the /Za option from the clang/CMakeLists.txt
file, but recompiling revealed some compile errors in some string class.
 Any thoughts on either how to make this work, or whether I should even be
trying to read the registry?

Note that using the registry would solve the problem of not being able to
see the environment variables when the tests are run.

I suppose I could hack up my own declarations for the needed registry
symbols, but that sounds bad.

On a related note, should not InitHeaderSearch also be using the target
triple information to determine which include path to use?  I've enclosed a
patch that attempts to do it.  This would be important for cross-compiling,
I gather.  It also has revised code for getting the Visual Studio include
path from the environment, plus the disabled code for the registry stuff.

-John

-- 
John Thompson
John.Thompson.JTSoftware at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20091007/9a429079/attachment.html>


More information about the cfe-dev mailing list