mirror of
https://github.com/php/php-src.git
synced 2024-11-23 09:54:15 +08:00
Fix GH-15094: php_random_default_engine() is not C++ conforming
Using compound literals is conforming to C99 (and up), but not with any C++ standard. Since the code is in a public header, it might be used by C++ extensions. Unfortunately, we cannot even used designated initializers, because these are a C++20 feature, so we stick with classic C/C++ code. Closes GH-15100.
This commit is contained in:
parent
82e63a06e2
commit
da72ac11f6
4
NEWS
4
NEWS
@ -42,6 +42,10 @@ PHP NEWS
|
||||
. pg_convert/pg_insert/pg_update/pg_delete ; regexes are now cached.
|
||||
(David Carlier)
|
||||
|
||||
- Random:
|
||||
. Fixed bug GH-15094 (php_random_default_engine() is not C++ conforming).
|
||||
(cmb)
|
||||
|
||||
- Standard:
|
||||
. Fix references in request_parse_body() options array. (nielsdos)
|
||||
. Add RoundingMode enum. (timwolla, saki)
|
||||
|
@ -167,10 +167,10 @@ PHPAPI void *php_random_default_status(void);
|
||||
|
||||
static inline php_random_algo_with_state php_random_default_engine(void)
|
||||
{
|
||||
return (php_random_algo_with_state){
|
||||
.algo = php_random_default_algo(),
|
||||
.state = php_random_default_status(),
|
||||
};
|
||||
php_random_algo_with_state raws;
|
||||
raws.algo = php_random_default_algo();
|
||||
raws.state = php_random_default_status();
|
||||
return raws;
|
||||
}
|
||||
|
||||
PHPAPI zend_string *php_random_bin2hex_le(const void *ptr, const size_t len);
|
||||
|
Loading…
Reference in New Issue
Block a user