diff --git a/src/bio.c b/src/bio.c index db6d85d577..e8e66597e6 100644 --- a/src/bio.c +++ b/src/bio.c @@ -24,10 +24,9 @@ #endif #include -#if defined(OPENSSL_EXTRA) && !defined(_WIN32) +#if defined(OPENSSL_EXTRA) && !defined(_WIN32) && !defined(_GNU_SOURCE) /* turn on GNU extensions for XVASPRINTF with wolfSSL_BIO_printf */ - #undef _GNU_SOURCE - #define _GNU_SOURCE + #define _GNU_SOURCE 1 #endif #if !defined(WOLFSSL_BIO_INCLUDED) diff --git a/src/ssl.c b/src/ssl.c index 8affb043a4..fd8a8f0128 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -25,10 +25,9 @@ #endif #include -#if defined(OPENSSL_EXTRA) && !defined(_WIN32) +#if defined(OPENSSL_EXTRA) && !defined(_WIN32) && !defined(_GNU_SOURCE) /* turn on GNU extensions for XISASCII */ - #undef _GNU_SOURCE - #define _GNU_SOURCE + #define _GNU_SOURCE 1 #endif #if !defined(WOLFCRYPT_ONLY) || defined(OPENSSL_EXTRA) || \ diff --git a/wolfssl/openssl/opensslv.h b/wolfssl/openssl/opensslv.h index 8d36ea24c7..481f74ee39 100644 --- a/wolfssl/openssl/opensslv.h +++ b/wolfssl/openssl/opensslv.h @@ -34,7 +34,10 @@ defined(OPENSSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER == 0x0090810fL) ||\ defined(OPENSSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER == 0x10100000L) ||\ defined(OPENSSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER == 0x10001040L) - /* valid version */ + /* valid version */ +#elif defined(OPENSSL_VERSION_NUMBER) + /* unrecognized version, but continue. */ + #define WOLFSSL_OPENSSL_VERSION_NUMBER_UNRECOGNIZED #elif defined(HAVE_MOSQUITTO) #define OPENSSL_VERSION_NUMBER 0x10100000L #elif defined(WOLFSSL_APACHE_HTTPD) || defined(HAVE_LIBEST) || \ @@ -57,11 +60,15 @@ #define OPENSSL_VERSION_NUMBER 0x0090810fL #endif -#define OPENSSL_VERSION_TEXT "wolfSSL " LIBWOLFSSL_VERSION_STRING -#define OPENSSL_VERSION 0 +#ifndef OPENSSL_VERSION_TEXT + #define OPENSSL_VERSION_TEXT "wolfSSL " LIBWOLFSSL_VERSION_STRING +#endif +#ifndef OPENSSL_VERSION + #define OPENSSL_VERSION 0 +#endif #ifndef OPENSSL_IS_WOLFSSL -#define OPENSSL_IS_WOLFSSL + #define OPENSSL_IS_WOLFSSL #endif #endif /* OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL */