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/freebl/blapit.h
65 +++ nss/lib/freebl/blapit.h
67 * Mark the old defines as deprecated. This will warn code that expected
68 * DSA1 only that they need to change if the are to support DSA2.
70 -#if defined(__GNUC__) && (__GNUC__ > 3)
71 +#if defined(__GNUC__) && (__GNUC__ > 3) || defined __clang__
72 /* make GCC warn when we use these #defines */
73 typedef int __BLAPI_DEPRECATED __attribute__((deprecated));
74 #define DSA_SUBPRIME_LEN ((__BLAPI_DEPRECATED)DSA1_SUBPRIME_LEN)
75 --- nss/lib/util/pkcs11n.h
76 +++ nss/lib/util/pkcs11n.h
78 /* keep the old value for compatibility reasons*/
79 #define CKT_NSS_MUST_VERIFY ((__CKT_NSS_MUST_VERIFY)(CKT_NSS + 4))
82 +#if defined _WIN32 && !defined __clang__
83 /* This magic gets the windows compiler to give us a deprecation
85 #pragma deprecated(CKT_NSS_UNTRUSTED, CKT_NSS_MUST_VERIFY, CKT_NSS_VALID)
88 # #pragma warning(disable : 4103)
89 # in the inner pkcs11p.h, clang-cl wants
90 # #pragma clang diagnostic ignored "-Wpragma-pack"
91 # in the outer pkcs11t.h:
92 --- nss/lib/util/pkcs11t.h
93 +++ nss/lib/util/pkcs11t.h
95 #define CK_INVALID_HANDLE 0
98 +#if defined __clang__ && defined _MSC_VER
99 +#pragma clang diagnostic push
100 +#pragma clang diagnostic ignored "-Wpragma-pack"
103 +#if defined __clang__ && defined _MSC_VER
104 +#pragma clang diagnostic pop
107 typedef struct CK_VERSION {
108 CK_BYTE major; /* integer portion of version number */
109 @@ -2586,6 +2593,13 @@
113 +#if defined __clang__ && defined _MSC_VER
114 +#pragma clang diagnostic push
115 +#pragma clang diagnostic ignored "-Wpragma-pack"
118 +#if defined __clang__ && defined _MSC_VER
119 +#pragma clang diagnostic pop