Skip to content

Commit 5087931

Browse files
authored
random: Add missing php.h include to php_random.h (#10764)
`PHPAPI` is defined in `php.h`. It appears that without the explicit include, recent versions of Visual Studio Code’s intellisense (rightfully) no longer detect `PHPAPI`. This will then lead to a misparsing of the file, because `PHPAPI` is assumed to be the return type and the actual return type is assumed to be the function name, thus expecting a semicolon after the actual return type. This in turn colors the entire header in red due to the detected syntax error(s), making development very hard / impossible. This did not cause issues outside of the IDE use case, because apparently all users of `php_random.h` include `php.h` before including `php_random.h`.
1 parent 1978a7b commit 5087931

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

ext/random/php_random.h

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
#ifndef PHP_RANDOM_H
3232
# define PHP_RANDOM_H
3333

34+
# include "php.h"
35+
3436
PHPAPI double php_combined_lcg(void);
3537

3638
/*

0 commit comments

Comments
 (0)