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.1 by schorsch, Thu Jun 5 19:29:34 2003 UTC vs.
Revision 3.7 by schorsch, Thu Jul 3 22:41:44 2003 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines