[libc-commits] [libc] [libc] Some more MSVC compatibility in src/__support. (PR #158108)
via libc-commits
libc-commits at lists.llvm.org
Thu Sep 11 10:29:25 PDT 2025
================
@@ -16,10 +16,32 @@
namespace LIBC_NAMESPACE_DECL {
// We rely on compiler preprocessor defines to allow for cross compilation.
+#ifdef LIBC_COMPILER_IS_MSVC
+#define __BYTE_ORDER__ 0
+#define __ORDER_LITTLE_ENDIAN__ 0
+#define __ORDER_BIG_ENDIAN__ 1
+
+LIBC_INLINE static uint16_t __builtin_bswap16(uint16_t v) {
----------------
lntue wrote:
refactored it to a generic `byte_swap` utility function.
https://github.com/llvm/llvm-project/pull/158108
More information about the libc-commits
mailing list