ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/platform.h
Revision: 3.6
Committed: Mon Jun 30 19:58:37 2003 UTC (20 years, 10 months ago) by schorsch
Content type: text/plain
Branch: MAIN
Changes since 3.5: +11 -6 lines
Log Message:
Got some feature dependency backwards.

File Contents

# User Rev Content
1 schorsch 3.6 /* RCSid $Id: platform.h,v 3.5 2003/06/30 14:59:11 schorsch Exp $ */
2 schorsch 3.1 /*
3     * platform.h - header file for platform specific definitions
4     */
5     #ifndef _RAD_PLATFORM_H_
6     #define _RAD_PLATFORM_H_
7 schorsch 3.2 #ifdef __cplusplus
8     extern "C" {
9     #endif
10 schorsch 3.1
11     #ifdef _WIN32
12    
13 schorsch 3.5 #include <stdio.h>
14     #define popen _popen
15     #define pclose _pclose
16 schorsch 3.6
17     #define NON_POSIX
18    
19     #include <sys/types.h>
20     #include <sys/stat.h>
21     #define RHAS_STAT
22     #define S_IFREG _S_IFREG
23     #define W_IFDIR _S_IFDIR
24    
25 schorsch 3.5 #include <fcntl.h> /* _O_BINARY, _O_TEXT */
26     #include <io.h> /* _setmode() */
27     #include <stdlib.h> /* _fmode */
28     #define SET_DEFAULT_BINARY() _fmode = _O_BINARY
29     #define SET_FILE_BINARY(fp) _setmode(fileno(fp),_O_BINARY)
30     #define SET_FD_BINARY(fd) _setmode(fd,_O_BINARY)
31 schorsch 3.1
32     #else /* _WIN32 */
33    
34 schorsch 3.5 #ifdef AMIGA
35     #define NON_POSIX
36     #else
37     /* assumedly posix systems */
38     #define RHAS_GETPWNAM
39 schorsch 3.6 #define RHAS_STAT
40 schorsch 3.5 #define RHAS_FORK_EXEC
41     #endif
42    
43     /* everybody except Windows */
44    
45     /* NOPs */
46     #define SET_DEFAULT_BINARY()
47     #define SET_FILE_BINARY(fp)
48     #define SET_FD_BINARY(fd)
49 schorsch 3.1
50     #endif /* _WIN32 */
51    
52 schorsch 3.2
53     #ifdef __cplusplus
54     }
55     #endif
56 schorsch 3.1 #endif /* _RAD_PLATFORM_H_ */
57