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.12 by schorsch, Fri Jun 6 16:38:47 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  
11 +
12   #include "copyright.h"
13  
14   #ifdef  NORANDOM
# Line 17 | Line 23
23  
24   #else
25  
26 < #ifdef  MSDOS
26 > #ifdef  _WIN32
27  
28 + #if (RAND_MAX <= 65536)
29   #define random()        ((long)rand()<<16^(long)rand()<<6^(long)rand()>>4)
30 + #else
31 + #define random()        rand()
32 + #endif
33   #define srandom(s)      srand((unsigned)(s))
34  
35 < #define frandom()       (rand()*(1./32768.))
35 > #define frandom()       (rand()*(1./RAND_MAX))
36  
37   #else
38   #ifdef  BSD
# Line 59 | Line 69 | extern int     urmask;
69  
70   #endif
71  
62 #ifdef NOPROTO
63
64 extern int      initurand();
65 extern int      ilhash();
66 extern int      urind();
67 extern void     multisamp();
68
69 #else
72                                  /* defined in urand.c */
73   extern int      initurand(int size);
74   extern int      ilhash(int *d, int n);
# Line 75 | Line 77 | extern int     urind(int s, int i);
77                                  /* defined in multisamp.c */
78   extern void     multisamp(double t[], int n, double r);
79  
80 +
81 + #ifdef __cplusplus
82 + }
83   #endif
84 + #endif /* _RAD_RANDOM_H_ */
85 +

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines