diff options
author | William Ahern <william@25thandclement.com> | 2016-11-23 16:48:39 -0800 |
---|---|---|
committer | William Ahern <william@25thandclement.com> | 2016-11-23 16:48:39 -0800 |
commit | f25f81ecda73b894066063050e1f706f3382c4cc (patch) | |
tree | 1801f2cf3a3de831426f3279fc62511e8a3f3880 /src | |
parent | 8ea3249320e8380c9abd2a119c7c450c0701cbf5 (diff) | |
download | luaossl-f25f81ecda73b894066063050e1f706f3382c4cc.tar.gz luaossl-f25f81ecda73b894066063050e1f706f3382c4cc.tar.bz2 luaossl-f25f81ecda73b894066063050e1f706f3382c4cc.zip |
use _MSC_FULL_VER not _MSC_VER_FULL, and use more common feature macro names for some builtins
Diffstat (limited to 'src')
-rw-r--r-- | src/openssl.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/openssl.c b/src/openssl.c index 63db361..b14090e 100644 --- a/src/openssl.c +++ b/src/openssl.c | |||
@@ -81,7 +81,7 @@ | |||
81 | #define GNUC_PREREQ(M, m, p) (__GNUC__ > 0 && GNUC_2VER(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__) >= GNUC_2VER((M), (m), (p))) | 81 | #define GNUC_PREREQ(M, m, p) (__GNUC__ > 0 && GNUC_2VER(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__) >= GNUC_2VER((M), (m), (p))) |
82 | 82 | ||
83 | #define MSC_2VER(M, m, p) ((((M) + 6) * 10000000) + ((m) * 1000000) + (p)) | 83 | #define MSC_2VER(M, m, p) ((((M) + 6) * 10000000) + ((m) * 1000000) + (p)) |
84 | #define MSC_PREREQ(M, m, p) (_MSC_VER_FULL > 0 && _MSC_VER_FULL >= MSC_2VER((M), (m), (p))) | 84 | #define MSC_PREREQ(M, m, p) (_MSC_FULL_VER > 0 && _MSC_FULL_VER >= MSC_2VER((M), (m), (p))) |
85 | 85 | ||
86 | #define OPENSSL_PREREQ(M, m, p) \ | 86 | #define OPENSSL_PREREQ(M, m, p) \ |
87 | (OPENSSL_VERSION_NUMBER >= (((M) << 28) | ((m) << 20) | ((p) << 12)) && !defined LIBRESSL_VERSION_NUMBER) | 87 | (OPENSSL_VERSION_NUMBER >= (((M) << 28) | ((m) << 20) | ((p) << 12)) && !defined LIBRESSL_VERSION_NUMBER) |
@@ -97,12 +97,16 @@ | |||
97 | #define __has_extension(x) 0 | 97 | #define __has_extension(x) 0 |
98 | #endif | 98 | #endif |
99 | 99 | ||
100 | #ifndef HAVE___ASSUME | 100 | #ifndef HAVE_C___ASSUME |
101 | #define HAVE___ASSUME MSC_PREREQ(8,0,0) | 101 | #define HAVE_C___ASSUME MSC_PREREQ(8,0,0) |
102 | #endif | 102 | #endif |
103 | 103 | ||
104 | #ifndef HAVE___BUILTIN_UNREACHABLE | 104 | #ifndef HAVE_C___BUILTIN_UNREACHABLE |
105 | #define HAVE___BUILTIN_UNREACHABLE (GNUC_PREREQ(4,5,0) || __has_builtin(__builtin_unreachable)) | 105 | #define HAVE_C___BUILTIN_UNREACHABLE (GNUC_PREREQ(4,5,0) || __has_builtin(__builtin_unreachable)) |
106 | #endif | ||
107 | |||
108 | #ifndef HAVE_C___DECLSPEC_NORETURN | ||
109 | #define HAVE_C___DECLSPEC_NORETURN MSC_PREREQ(8,0,0) | ||
106 | #endif | 110 | #endif |
107 | 111 | ||
108 | #ifndef HAVE_ASN1_STRING_GET0_DATA | 112 | #ifndef HAVE_ASN1_STRING_GET0_DATA |
@@ -342,9 +346,9 @@ | |||
342 | #define NOTUSED | 346 | #define NOTUSED |
343 | #endif | 347 | #endif |
344 | 348 | ||
345 | #if HAVE___BUILTIN_UNREACHABLE | 349 | #if HAVE_C___BUILTIN_UNREACHABLE |
346 | #define NOTREACHED __builtin_unreachable() | 350 | #define NOTREACHED __builtin_unreachable() |
347 | #elif HAVE___ASSUME | 351 | #elif HAVE_C___ASSUME |
348 | #define NOTREACHED __assume(0) | 352 | #define NOTREACHED __assume(0) |
349 | #else | 353 | #else |
350 | #define NOTREACHED (void)0 | 354 | #define NOTREACHED (void)0 |