summaryrefslogtreecommitdiff
path: root/absl/random
diff options
context:
space:
mode:
authorGravatar Copybara-Service <copybara-worker@google.com>2023-05-22 14:15:08 -0700
committerGravatar Copybara-Service <copybara-worker@google.com>2023-05-22 14:15:08 -0700
commit051aa9805f28cf156d232b6319f09da4d5b5cb3e (patch)
tree5db546b919a865a06cf90c8fa5b50dbaa1213a5e /absl/random
parent02d1f5e18bb12d9aecade624eb339c319fd866d4 (diff)
parentbd748714ce32841d410b1b8ec5f2daa5043ee6b2 (diff)
Merge pull request #1452 from niranjan-nilakantan:niranjan-nilakantan/issue1358
PiperOrigin-RevId: 534179290 Change-Id: I9ad24518cc6a336fbaf602269fb01319491c8b60
Diffstat (limited to 'absl/random')
-rw-r--r--absl/random/internal/randen_detect.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/absl/random/internal/randen_detect.cc b/absl/random/internal/randen_detect.cc
index 6dababa3..bdeab877 100644
--- a/absl/random/internal/randen_detect.cc
+++ b/absl/random/internal/randen_detect.cc
@@ -45,6 +45,10 @@
#if defined(ABSL_INTERNAL_USE_X86_CPUID)
#if defined(_WIN32) || defined(_WIN64)
#include <intrin.h> // NOLINT(build/include_order)
+#elif ABSL_HAVE_BUILTIN(__cpuid)
+// MSVC-equivalent __cpuid intrinsic declaration for clang-like compilers
+// for non-Windows build environments.
+extern void __cpuid(int[4], int);
#else
// MSVC-equivalent __cpuid intrinsic function.
static void __cpuid(int cpu_info[4], int info_type) {