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

Comparing ray/src/common/platform.h (file contents):
Revision 3.4 by greg, Fri Jun 27 06:53:21 2003 UTC vs.
Revision 3.10 by schorsch, Tue Oct 21 19:19:28 2003 UTC

# Line 4 | Line 4
4   */
5   #ifndef _RAD_PLATFORM_H_
6   #define _RAD_PLATFORM_H_
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
7  
8   #ifdef _WIN32
9  
10 < #include <stdio.h>
11 < #define popen _popen
15 < #define pclose _pclose
16 < #include <fcntl.h>  /* _O_BINARY, _O_TEXT */
17 < #include <io.h>     /* _setmode() */
18 < #include <stdlib.h> /* _fmode */
10 >  #include <io.h>     /* _setmode() and stuff from unistd.h */
11 >  typedef long off_t;
12  
13 < #define SET_DEFAULT_BINARY() _fmode = _O_BINARY
14 < #define SET_FILE_BINARY(fp) _setmode(fileno(fp),_O_BINARY)
15 < #define SET_FD_BINARY(fd) _setmode(fd,_O_BINARY)
13 >  #include <stdio.h>
14 >  #define popen _popen
15 >  #define pclose _pclose
16 >  #define snprintf _snprintf
17  
18 +  #include <windows.h>
19 +  #define sleep(s) Sleep(s*1000)
20  
21 +  #define NON_POSIX
22  
23 +  #include <sys/types.h>
24 +  #include <sys/stat.h>
25 +  #define RHAS_STAT
26 +  #define S_IFREG _S_IFREG
27 +  #define W_IFDIR _S_IFDIR
28  
29 +  #include <fcntl.h>  /* _O_BINARY, _O_TEXT */
30 +  #include <stdlib.h> /* _fmode */
31 +  #define SET_DEFAULT_BINARY() _fmode = _O_BINARY
32 +  #define SET_FILE_BINARY(fp) _setmode(fileno(fp),_O_BINARY)
33 +  #define SET_FD_BINARY(fd) _setmode(fd,_O_BINARY)
34  
28
29
35   #else /* _WIN32 */
36  
37 < /* NOPs on unix */
38 < #define SET_DEFAULT_BINARY()
39 < #define SET_FILE_BINARY(fp)
40 < #define SET_FD_BINARY(fd)
37 >  #ifdef AMIGA
38 >    #define NON_POSIX
39 >  #else
40 >    /* assumedly posix systems */
41 >        #include <unistd.h>
42 >    #define RHAS_GETPWNAM
43 >    #define RHAS_STAT
44 >    #define RHAS_FORK_EXEC
45 >  #endif
46  
47 +  /* everybody except Windows */
48  
49 +  /* NOPs */
50 +  #define SET_DEFAULT_BINARY()
51 +  #define SET_FILE_BINARY(fp)
52 +  #define SET_FD_BINARY(fd)
53  
39
40
41
42
54   #endif /* _WIN32 */
55  
56 + #ifdef __cplusplus
57 + extern "C" {
58 + #endif
59 +
60 + /* nothing to protect yet */
61  
62   #ifdef __cplusplus
63   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines