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.9 by greg, Tue Feb 25 02:47:21 2003 UTC vs.
Revision 2.13 by greg, Fri Jun 27 06:53:21 2003 UTC

# Line 2 | Line 2
2   /*
3   *  random.h - header file for random(3) and urand() function.
4   */
5 + #ifndef _RAD_RANDOM_H_
6 + #define _RAD_RANDOM_H_
7 + #ifdef __cplusplus
8 + extern "C" {
9 + #endif
10  
6 #include "copyright.h"
7
11   #ifdef  NORANDOM
12  
13   #undef  random
# Line 17 | Line 20
20  
21   #else
22  
23 < #ifdef  MSDOS
23 > #ifdef  _WIN32
24  
25 + #if (RAND_MAX <= 65536)
26   #define random()        ((long)rand()<<16^(long)rand()<<6^(long)rand()>>4)
27 + #else
28 + #define random()        rand()
29 + #endif
30   #define srandom(s)      srand((unsigned)(s))
31  
32 < #define frandom()       (rand()*(1./32768.))
32 > #define frandom()       (rand()*(1./RAND_MAX))
33  
34   #else
35   #ifdef  BSD
# Line 59 | Line 66 | extern int     urmask;
66  
67   #endif
68  
62 #ifdef NOPROTO
63
64 extern int      initurand();
65 extern int      ilhash();
66 extern int      urind();
67 extern void     multisamp();
68
69 #else
69                                  /* defined in urand.c */
70   extern int      initurand(int size);
71   extern int      ilhash(int *d, int n);
# Line 75 | Line 74 | extern int     urind(int s, int i);
74                                  /* defined in multisamp.c */
75   extern void     multisamp(double t[], int n, double r);
76  
77 +
78 + #ifdef __cplusplus
79 + }
80   #endif
81 + #endif /* _RAD_RANDOM_H_ */
82 +

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines