Patch for `include/llvm/Support/Host.h` to support BSD and Solaris endian.h equivalents

Rafael EspĂ­ndola rafael.espindola at gmail.com
Mon Dec 2 07:33:11 PST 2013


On 1 December 2013 23:56, Samuel Marks <samuelmarks at hotmail.com> wrote:
> Actually I was getting is:
> ost.h:23:28: fatal error: machine/endian.h: No such file or directory
>
> http://llvm.org/bugs/show_bug.cgi?id=17831
>
> Reviewing the patch you referenced, I see it is not including the right library for Solaris. Additionally I have expanded the support to include the relevant library/libraries for the popular BSD [and Solaris] Operating Systems.


Oh, I see. The problem was not the endian not being defined, it was
trying to include a non-existing header.

We should not have both fixes in tree. Can you send a new patch that
also reverts r182419?

-#if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && BYTE_ORDER == BIG_ENDIAN
-  static const bool IsBigEndianHost = true;
+#if defined(BIG_ENDIAN)

This is wrong, BIG_ENDIAN is defined to 4321 even on little endian
machine. You have to compare with BYTE_ORDER.

-  static const bool IsLittleEndianHost = !IsBigEndianHost;

Why remove this?


Cheers,
Rafael



More information about the llvm-commits mailing list