[LLVMdev] COFF.h and windows.h conflict

Reid Kleckner rnk at google.com
Thu Aug 29 09:42:18 PDT 2013


On Wed, Aug 28, 2013 at 7:19 PM, Virgile Bello <virgile.bello at gmail.com>wrote:

> It was happening in a few files using COFF.h in LLDB for the windows
> branch (Windows.h is required for some typedef over Mutex, thread, socket,
> etc...).
>

Can you write opaque wrappers for these things?  Then you could include
windows.h from the .cpp file and avoid it in any headers.  Keeping
windows.h out of your transitive includes is nice anyway.  You shouldn't
need COFF.h in the .cpp implementation files.

In LLVM, most of this kind of functionality is in lib/Support, and nothing
in include/llvm/Support includes windows.h.


> As said before, I am currently checking if it could be avoided (probably
> some refactoring will be needed). However I was wondering if it might not
> be easier to just avoid this clash at all by avoiding it in LLVM.
>

I'd prefer it if you evaluated this first, but if it's too hard, yeah,
let's change COFF.h.


> Alternatively I could #undef everything right after including Windows.h.
>

I'd rather avoid this.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130829/37133faf/attachment.html>


More information about the llvm-dev mailing list