Conversation

__BYTE_ORDER__ and __ORDER_[LITTLE|BIG]_ENDIAN__ work on GCC, Clang on Windows, include Windows.h and define __BYTE_ORDER__ as REG_DWORD, and __ORDER_LITTLE_ENDIAN__ as REG_DWORD_LITTLE_ENDIAN.
Image
Quote Tweet
There is still no standard way that I'm aware of to determine the CPU's endianness at compile time with C/C++. I have to use a bunch of platform specific #ifdef's, include the right headers, etc. It's painful. OSX doesn't define "__BYTE_ORDER", neither does MSVC.
Show this thread
2
10