From 983c94e4607bed48ab796d3d33aa34469acc9e6d Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Wed, 4 Sep 2024 14:23:29 +0200 Subject: [PATCH] Fix GH-15742: php_hash_sha.h incompatible with C++ Not only MSVC doesn't support this construct, but apparently it is generally not supported by C++ compilers. --- ext/hash/php_hash_sha.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/hash/php_hash_sha.h b/ext/hash/php_hash_sha.h index d5b04ddd2f479..748a2b2d63e32 100644 --- a/ext/hash/php_hash_sha.h +++ b/ext/hash/php_hash_sha.h @@ -45,7 +45,7 @@ typedef struct { PHP_HASH_API void PHP_SHA256InitArgs(PHP_SHA256_CTX *, ZEND_ATTRIBUTE_UNUSED HashTable *); PHP_HASH_API void PHP_SHA256Update(PHP_SHA256_CTX *, const unsigned char *, size_t); -#ifdef _MSC_VER +#if defined(__cplusplus) || defined(_MSC_VER) # define PHP_STATIC_RESTRICT #else # define PHP_STATIC_RESTRICT static restrict