summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Derek Mauro <dmauro@google.com>2022-11-28 09:56:36 -0800
committerGravatar Copybara-Service <copybara-worker@google.com>2022-11-28 09:57:27 -0800
commite3158086978de4ff15a2058f49ba525c89e14ce6 (patch)
tree3dc65f352374ad52195e378d35578154d192750a
parent04596b253fb511069538cab453166c05a1567705 (diff)
Use ABSL_HAVE_BUILTIN to fix -Wundef __has_builtin warning
Fixes #1329 PiperOrigin-RevId: 491372279 Change-Id: I93c094b06ece9cb9bdb39fd4541353e0344a1a57
-rw-r--r--absl/crc/BUILD.bazel3
-rw-r--r--absl/crc/CMakeLists.txt4
-rw-r--r--absl/crc/internal/non_temporal_arm_intrinsics.h4
3 files changed, 9 insertions, 2 deletions
diff --git a/absl/crc/BUILD.bazel b/absl/crc/BUILD.bazel
index fa3e006b..bceb7258 100644
--- a/absl/crc/BUILD.bazel
+++ b/absl/crc/BUILD.bazel
@@ -115,6 +115,9 @@ cc_library(
copts = ABSL_DEFAULT_COPTS,
linkopts = ABSL_DEFAULT_LINKOPTS,
visibility = ["//visibility:private"],
+ deps = [
+ "//absl/base:config",
+ ],
)
cc_library(
diff --git a/absl/crc/CMakeLists.txt b/absl/crc/CMakeLists.txt
index 02c86aca..e1093c9f 100644
--- a/absl/crc/CMakeLists.txt
+++ b/absl/crc/CMakeLists.txt
@@ -26,7 +26,7 @@ absl_cc_library(
absl::base
absl::config
)
-
+
# Internal-only target, do not depend on directly.
absl_cc_library(
NAME
@@ -101,6 +101,8 @@ absl_cc_library(
"internal/non_temporal_arm_intrinsics.h"
COPTS
${ABSL_DEFAULT_COPTS}
+ DEPS
+ absl::config
)
# Internal-only target, do not depend on directly.
diff --git a/absl/crc/internal/non_temporal_arm_intrinsics.h b/absl/crc/internal/non_temporal_arm_intrinsics.h
index 92632a33..9e5ccfc4 100644
--- a/absl/crc/internal/non_temporal_arm_intrinsics.h
+++ b/absl/crc/internal/non_temporal_arm_intrinsics.h
@@ -15,6 +15,8 @@
#ifndef ABSL_CRC_INTERNAL_NON_TEMPORAL_ARM_INTRINSICS_H_
#define ABSL_CRC_INTERNAL_NON_TEMPORAL_ARM_INTRINSICS_H_
+#include "absl/base/config.h"
+
#ifdef __aarch64__
#include <arm_neon.h>
@@ -51,7 +53,7 @@ static inline __attribute__((always_inline)) __m128i _mm_loadu_si128(
// https://msdn.microsoft.com/en-us/library/ba08y07y%28v=vs.90%29.aspx
static inline __attribute__((always_inline)) void _mm_stream_si128(__m128i *p,
__m128i a) {
-#if __has_builtin(__builtin_nontemporal_store)
+#if ABSL_HAVE_BUILTIN(__builtin_nontemporal_store)
__builtin_nontemporal_store(a, p);
#else
vst1q_s64((int64_t *)p, vreinterpretq_s64_m128i(a));