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.24 by greg, Thu Apr 21 02:52:40 2022 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 23 | Line 23 | extern "C" {
23  
24   #else
25  
26 extern long  lrand48();
27 extern double  drand48();
28
26   #define  random()       lrand48()
27   #define  srandom(s)     srand48((long)(s))
28   #define  frandom()      drand48()
# Line 38 | Line 35 | extern int     urmask;
35   #define  urand(i)       (urmask ? (urperm[(i)&urmask]+frandom())/(urmask+1.) \
36                                  : frandom())
37  
38 +                                /* defined in urand.c */
39 + extern long     irandom(long modulus);
40 +
41   extern int      initurand(int size);
42  
43                                /* defined in urand.c */
43   extern int      ilhash(int *d, int n);
44 <                                /* defined in urind.c */
44 >
45   extern int      urind(int s, int i);
46                                  /* defined in multisamp.c */
47   extern void     multisamp(double t[], int n, double r);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines