[libc-commits] [PATCH] D100571: [libc] Add endianness support

Guillaume Chatelet via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Apr 15 08:46:35 PDT 2021


gchatelet added a comment.

Let me know if you want this header to live somewhere else, or if you had other plans in mind.



================
Comment at: libc/src/__support/endian.h:30
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+#define LLVM_LIBC_IS_LITTLE_ENDIAN 1
+#else
----------------
Here I decided to always define the symbol and set it to 0 or 1 but maybe it's better to leave it undefined. I fear that someone writes `#ifdef LLVM_LIBC_IS_LITTLE_ENDIAN`. It would always be true.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100571/new/

https://reviews.llvm.org/D100571



More information about the libc-commits mailing list