From f256c39541c6ef2cbccb507296d4b58c6c6c1d2b Mon Sep 17 00:00:00 2001 From: Guillaume Chatelet Date: Fri, 8 Oct 2021 14:25:08 +0000 Subject: [PATCH] [libc] ifdef guard element architecture implementations --- libc/src/string/memory_utils/elements_aarch64.h | 4 ++++ libc/src/string/memory_utils/elements_x86.h | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/libc/src/string/memory_utils/elements_aarch64.h b/libc/src/string/memory_utils/elements_aarch64.h index 366efc181e9a..36d3074bac5b 100644 --- a/libc/src/string/memory_utils/elements_aarch64.h +++ b/libc/src/string/memory_utils/elements_aarch64.h @@ -9,6 +9,8 @@ #ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_ELEMENTS_AARCH64_H #define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_ELEMENTS_AARCH64_H +#if defined(__arm__) || defined(__aarch64__) + #include #include // size_t #include // uint8_t, uint16_t, uint32_t, uint64_t @@ -113,4 +115,6 @@ using _32 = __llvm_libc::scalar::_32; } // namespace aarch64 } // namespace __llvm_libc +#endif // defined(__arm__) || defined(__aarch64__) + #endif // LLVM_LIBC_SRC_STRING_MEMORY_UTILS_ELEMENTS_AARCH64_H diff --git a/libc/src/string/memory_utils/elements_x86.h b/libc/src/string/memory_utils/elements_x86.h index 2873fff8b2e2..c7e1ff901795 100644 --- a/libc/src/string/memory_utils/elements_x86.h +++ b/libc/src/string/memory_utils/elements_x86.h @@ -9,6 +9,9 @@ #ifndef LLVM_LIBC_SRC_STRING_MEMORY_UTILS_ELEMENTS_X86_H #define LLVM_LIBC_SRC_STRING_MEMORY_UTILS_ELEMENTS_X86_H +#if defined(__i386__) || defined(_M_IX86) || defined(__x86_64__) || \ + defined(_M_X64) + #include // size_t #include // uint8_t, uint16_t, uint32_t, uint64_t @@ -163,4 +166,7 @@ using _128 = __llvm_libc::Repeated<_8, 16>; } // namespace x86 } // namespace __llvm_libc +#endif // defined(__i386__) || defined(_M_IX86) || defined(__x86_64__) || + // defined(_M_X64) + #endif // LLVM_LIBC_SRC_STRING_MEMORY_UTILS_ELEMENTS_X86_H