diff --git a/include/openssl/base.h b/include/openssl/base.h index cc962f313..9edaa5ca0 100644 --- a/include/openssl/base.h +++ b/include/openssl/base.h @@ -228,9 +228,10 @@ extern "C" { #define OPENSSL_FALLTHROUGH [[fallthrough]] #elif defined(__cplusplus) && __cplusplus >= 201103L && defined(__clang__) #define OPENSSL_FALLTHROUGH [[clang::fallthrough]] -#elif defined(__cplusplus) && __cplusplus >= 201103L && __GNUC__ >= 7 +#elif defined(__cplusplus) && __cplusplus >= 201103L && defined(__GNUC__) && \ + __GNUC__ >= 7 #define OPENSSL_FALLTHROUGH [[gnu::fallthrough]] -#elif __GNUC__ >= 7 // gcc 7 +#elif defined(__GNUC__) && __GNUC__ >= 7 // gcc 7 #define OPENSSL_FALLTHROUGH __attribute__ ((fallthrough)) #else // C++11 on gcc 6, and all other cases #define OPENSSL_FALLTHROUGH diff --git a/include/openssl/stack.h b/include/openssl/stack.h index 46f57a34c..625f66e43 100644 --- a/include/openssl/stack.h +++ b/include/openssl/stack.h @@ -344,7 +344,7 @@ struct StackTraits {}; sk_##name##_deep_copy(const STACK_OF(name) *sk, \ ptrtype(*copy_func)(ptrtype), \ void (*free_func)(ptrtype)) { \ - return (STACK_OF(name) *)sk_deep_copy((_STACK *)sk, \ + return (STACK_OF(name) *)sk_deep_copy((const _STACK *)sk, \ (void *(*)(void *))copy_func, \ (void (*)(void *))free_func); \ }