[LLVMdev] COFF.h and windows.h conflict

Virgile Bello virgile.bello at gmail.com
Wed Aug 28 19:05:03 PDT 2013


Right now, we have:
In COFF.h:
    class COFF { enum MachineTypes { IMAGE_FILE_MACHINE_UNKNOWN   = 0x0,
... }; };
In windows.h:
    #define IMAGE_FILE_MACHINE_UNKNOWN 0

* If you first include COFF.h and then windows.h,
    COFF::IMAGE_FILE_MACHINE_UNKNOWN
will be preprocessed into
    COFF:0.

* If you first include Windows.h and then COFF.h, COFF.h won't work because
it's enum will become:
    enum MachinTypes { 0 = 0x0 };


On Thu, Aug 29, 2013 at 6:03 AM, Nick Kledzik <kledzik at apple.com> wrote:

>
> On Aug 27, 2013, at 5:56 PM, Virgile Bello <virgile.bello at gmail.com>
> wrote:
>
> Yes of course I understand it was done on purpose.
> It's just that it makes it impossible to include COFF.h and Windows.h side
> by side (which probably wasn't necessary until now).
>
>
> I too am in the camp that it is a feature to use the standard names.  For
> instance doing a search it google or github of the documented names will
> find uses.
>
> Where exactly is the conflict happening?    Is the problem that something
> in llvm is including windows.h?  Or that some std lib C/C++ header is being
> included and the OS provided std header is including windows.h?
>
> -Nick
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130829/46b0908a/attachment.html>


More information about the llvm-dev mailing list