Skip to content

Commit 5d1181f

Browse files
committed
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. Closes GH-15745.
1 parent d552fbd commit 5d1181f

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

NEWS

+3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ PHP NEWS
3030
- GD:
3131
. Added gdImageClone to bundled libgd. (David Carlier)
3232

33+
- Hash:
34+
. Fixed bug GH-15742 (php_hash_sha.h incompatible with C++). (cmb)
35+
3336
- OpenSSL:
3437
. Implement GH-13514 PASSWORD_ARGON2 from OpenSSL 3.2. (Remi)
3538

ext/hash/php_hash_sha.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ typedef struct {
4545
PHP_HASH_API void PHP_SHA256InitArgs(PHP_SHA256_CTX *, ZEND_ATTRIBUTE_UNUSED HashTable *);
4646
PHP_HASH_API void PHP_SHA256Update(PHP_SHA256_CTX *, const unsigned char *, size_t);
4747

48-
#ifdef _MSC_VER
48+
#if defined(__cplusplus) || defined(_MSC_VER)
4949
# define PHP_STATIC_RESTRICT
5050
#else
5151
# define PHP_STATIC_RESTRICT static restrict

0 commit comments

Comments
 (0)