]> granicus.if.org Git - php/commitdiff
Hopefully fix compile warnings on win32 systems
authorSterling Hughes <sterling@php.net>
Sun, 16 Sep 2001 17:37:19 +0000 (17:37 +0000)
committerSterling Hughes <sterling@php.net>
Sun, 16 Sep 2001 17:37:19 +0000 (17:37 +0000)
ext/standard/rand.c

index 50f09e2e4c90e31c779ae163f358c83c10b63778..e68acad46f997ed4395466e53b0a8848f30f29c0 100644 (file)
 
 #include <stdlib.h>
 
+#ifdef PHP_WIN32
+#include <windows.h>
+#endif
+
 #include "php.h"
 #include "php_math.h"
 #include "php_rand.h"
+#include "php_lcg.h"
 
 #include "basic_functions.h"
 
@@ -192,7 +197,11 @@ PHPAPI php_uint32 php_mt_rand(TSRMLS_D)
        return y ^ (y >> 18);
 }
 
+#ifdef PHP_WIN32
+#define GENERATE_SEED() (time(0) * GetCurrentProcessId() * 1000000 * php_combined_lcg(TSRMLS_C))
+#else
 #define GENERATE_SEED() (time(0) * getpid() * 1000000 * php_combined_lcg(TSRMLS_C))
+#endif
 
 /* {{{ proto void srand([int seed])
    Seeds random number generator */