[libc] ifdef guard element architecture implementations
authorGuillaume Chatelet <gchatelet@google.com>
Fri, 8 Oct 2021 14:25:08 +0000 (14:25 +0000)
committerGuillaume Chatelet <gchatelet@google.com>
Fri, 8 Oct 2021 14:25:26 +0000 (14:25 +0000)
libc/src/string/memory_utils/elements_aarch64.h
libc/src/string/memory_utils/elements_x86.h

index 366efc181e9a71a876d7a924f4ac73bd4e4219ed..36d3074bac5bfccc5131c23134d3f1348d4505c7 100644 (file)
@@ -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 <src/string/memory_utils/elements.h>
 #include <stddef.h> // size_t
 #include <stdint.h> // 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
index 2873fff8b2e2221c39ebbd148536c290af1a05e4..c7e1ff9017954d08c3bc70f19c4e41d99080a6d5 100644 (file)
@@ -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 <stddef.h> // size_t
 #include <stdint.h> // 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