ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/random.h
(Generate patch)

Comparing ray/src/common/random.h (file contents):
Revision 2.20 by greg, Wed May 27 08:37:26 2015 UTC vs.
Revision 2.23 by schorsch, Sun Mar 6 01:13:17 2016 UTC

# Line 4 | Line 4
4   */
5   #ifndef _RAD_RANDOM_H_
6   #define _RAD_RANDOM_H_
7 +
8 + #include <stdlib.h>
9 +
10   #ifdef __cplusplus
11   extern "C" {
12   #endif
13  
14 < #ifdef  _WIN32
12 <
13 < #include <stdlib.h>
14 <
14 > #if defined(_WIN32) || defined(_WIN64)
15   #if (RAND_MAX <= 65536)
16   #define random()        ((long)rand()<<16^(long)rand()<<6^(long)rand()>>4)
17   #else
# Line 22 | Line 22 | extern "C" {
22   #define frandom()       (rand()*(1./(RAND_MAX+.5)))
23  
24   #else
25
26 extern long  lrand48();
27 extern double  drand48();
25  
26   #define  random()       lrand48()
27   #define  srandom(s)     srand48((long)(s))

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines