Skip to content

Commit 4ffbb46

Browse files
committed
Fix "macro expansion producing 'defined' has undefined behavior" clang warning
1 parent a802940 commit 4ffbb46

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

libi2pd/Crypto.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,12 @@ namespace crypto
262262

263263
// take care about openssl version
264264
#include <openssl/opensslv.h>
265-
#define LEGACY_OPENSSL ((OPENSSL_VERSION_NUMBER < 0x010100000) || defined(LIBRESSL_VERSION_NUMBER)) // 1.0.2 and below or LibreSSL
265+
#if ((OPENSSL_VERSION_NUMBER < 0x010100000) || defined(LIBRESSL_VERSION_NUMBER)) // 1.0.2 and below or LibreSSL
266+
# define LEGACY_OPENSSL 1
267+
#else
268+
# define LEGACY_OPENSSL 0
269+
#endif
270+
266271
#if LEGACY_OPENSSL
267272
// define getters and setters introduced in 1.1.0
268273
inline int DSA_set0_pqg(DSA *d, BIGNUM *p, BIGNUM *q, BIGNUM *g)

0 commit comments

Comments
 (0)