# HG changeset patch
# User Makoto Kato <m_kato@ga2.so-net.ne.jp>
# Date 1549579831 25200
#      Thu Feb 07 15:50:31 2019 -0700
# Node ID 753fe0f7964c3faef5e4410ed7e0c965df7b180b
# Parent  5f4fed68d661de81638c8e1f108aff075a33d46e
diff --git a/pr/include/prbit.h b/pr/include/prbit.h
--- a/nspr/pr/include/prbit.h
+++ b/nspr/pr/include/prbit.h
@@ -14,7 +14,8 @@
 ** functions.
 */
 #if defined(_WIN32) && (_MSC_VER >= 1300) && \
-    (defined(_M_IX86) || defined(_M_AMD64) || defined(_M_ARM))
+    (defined(_M_IX86) || defined(_M_X64) || defined(_M_ARM) || \
+     defined(_M_ARM64))
 # include <intrin.h>
 # pragma  intrinsic(_BitScanForward,_BitScanReverse)
   __forceinline static int __prBitScanForward32(unsigned int val)
@@ -33,7 +34,8 @@
 # define pr_bitscan_clz32(val)  __prBitScanReverse32(val)
 # define  PR_HAVE_BUILTIN_BITSCAN32
 #elif ((__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) && \
-       (defined(__i386__) || defined(__x86_64__) || defined(__arm__))
+       (defined(__i386__) || defined(__x86_64__) || defined(__arm__) || \
+        defined(__aarch64__))
 # define pr_bitscan_ctz32(val)  __builtin_ctz(val)
 # define pr_bitscan_clz32(val)  __builtin_clz(val)
 # define  PR_HAVE_BUILTIN_BITSCAN32
@@ -136,7 +138,7 @@
 */
 
 #if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_AMD64) || \
-    defined(_M_X64) || defined(_M_ARM))
+    defined(_M_X64) || defined(_M_ARM) || defined(_M_ARM64))
 #include <stdlib.h>
 #pragma intrinsic(_rotl, _rotr)
 #define PR_ROTATE_LEFT32(a, bits) _rotl(a, bits)
