File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 37
37
38
38
PHPAPI double php_combined_lcg (void );
39
39
40
+ static inline zend_long GENERATE_SEED (void )
41
+ {
42
+ zend_ulong pid ;
43
+
40
44
# ifdef PHP_WIN32
41
- # define GENERATE_SEED () (((zend_long) (( zend_ulong) time(NULL) * (zend_ulong) GetCurrentProcessId())) ^ ((zend_long) (1000000.0 * php_combined_lcg())))
45
+ pid = ( zend_ulong ) GetCurrentProcessId ();
42
46
# else
43
- # define GENERATE_SEED () (((zend_long) (( zend_ulong) time(NULL) * (zend_ulong) getpid())) ^ ((zend_long) (1000000.0 * php_combined_lcg())))
47
+ pid = ( zend_ulong ) getpid ();
44
48
# endif
45
49
50
+ return (((zend_long ) ((zend_ulong ) time (NULL ) * pid )) ^ ((zend_long ) (1000000.0 * php_combined_lcg ())));
51
+ }
52
+
46
53
# define PHP_MT_RAND_MAX ((zend_long) (0x7FFFFFFF)) /* (1<<31) - 1 */
47
54
48
55
enum php_random_mt19937_mode {
You can’t perform that action at this time.
0 commit comments