1 # "#pragma deprecated" and "#pragma intrinsic" not (yet?) handled in the "if
2 # (LangOpts.MicrosoftExt)" block in Preprocessor::RegisterBuiltinPragmas in
3 # Clang's lib/Lex/Pragma.cpp:
4 --- nspr/pr/include/pratom.h
5 +++ nspr/pr/include/pratom.h
11 +#if defined _WIN32 && !defined __clang__
12 #pragma intrinsic(_InterlockedIncrement)
13 #pragma intrinsic(_InterlockedDecrement)
14 #pragma intrinsic(_InterlockedExchange)
15 --- nspr/pr/include/prbit.h
16 +++ nspr/pr/include/prbit.h
19 #if defined(_WIN32) && (_MSC_VER >= 1300) && \
20 (defined(_M_IX86) || defined(_M_X64) || defined(_M_ARM) || \
22 + defined(_M_ARM64)) && !defined __clang__
24 # pragma intrinsic(_BitScanForward,_BitScanReverse)
25 __forceinline static int __prBitScanForward32(unsigned int val)
27 # define pr_bitscan_ctz32(val) __prBitScanForward32(val)
28 # define pr_bitscan_clz32(val) __prBitScanReverse32(val)
29 # define PR_HAVE_BUILTIN_BITSCAN32
30 -#elif ((__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) && \
31 +#elif defined __GNUC__ && ((__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) && \
32 (defined(__i386__) || defined(__x86_64__) || defined(__arm__) || \
34 # define pr_bitscan_ctz32(val) __builtin_ctz(val)
38 #if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_AMD64) || \
39 - defined(_M_X64) || defined(_M_ARM) || defined(_M_ARM64))
40 + defined(_M_X64) || defined(_M_ARM) || defined(_M_ARM64)) && !defined __clang__
42 #pragma intrinsic(_rotl, _rotr)
43 #define PR_ROTATE_LEFT32(a, bits) _rotl(a, bits)
44 --- nss/lib/certdb/certdb.h
45 +++ nss/lib/certdb/certdb.h
47 /* On Windows, Mac, and Linux (and other gcc platforms), we can give compile
48 * time deprecation warnings when applications use the old CERTDB_VALID_PEER
51 +#if defined __GNUC__ && __GNUC__ > 3
52 #if (__GNUC__ == 4) && (__GNUC_MINOR__ < 5)
53 typedef unsigned int __CERTDB_VALID_PEER __attribute__((deprecated));
57 #define CERTDB_VALID_PEER ((__CERTDB_VALID_PEER)CERTDB_TERMINAL_RECORD)
60 +#if defined _WIN32 && !defined __clang__
61 #pragma deprecated(CERTDB_VALID_PEER)
63 #define CERTDB_VALID_PEER CERTDB_TERMINAL_RECORD
64 --- nss/lib/util/pkcs11n.h
65 +++ nss/lib/util/pkcs11n.h
67 /* keep the old value for compatibility reasons*/
68 #define CKT_NSS_MUST_VERIFY ((__CKT_NSS_MUST_VERIFY)(CKT_NSS + 4))
71 +#if defined _WIN32 && !defined __clang__
72 /* This magic gets the windows compiler to give us a deprecation
74 #pragma deprecated(CKT_NSS_UNTRUSTED, CKT_NSS_MUST_VERIFY, CKT_NSS_VALID)
77 # #pragma warning(disable : 4103)
78 # in the inner pkcs11p.h, clang-cl wants
79 # #pragma clang diagnostic ignored "-Wpragma-pack"
80 # in the outer pkcs11t.h:
81 --- nss/lib/util/pkcs11t.h
82 +++ nss/lib/util/pkcs11t.h
84 #define CK_INVALID_HANDLE 0
87 +#if defined __clang__ && defined _MSC_VER
88 +#pragma clang diagnostic push
89 +#pragma clang diagnostic ignored "-Wpragma-pack"
92 +#if defined __clang__ && defined _MSC_VER
93 +#pragma clang diagnostic pop
96 typedef struct CK_VERSION {
97 CK_BYTE major; /* integer portion of version number */
98 @@ -1795,6 +1802,13 @@
102 +#if defined __clang__ && defined _MSC_VER
103 +#pragma clang diagnostic push
104 +#pragma clang diagnostic ignored "-Wpragma-pack"
107 +#if defined __clang__ && defined _MSC_VER
108 +#pragma clang diagnostic pop