ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/platform.h
Revision: 3.5
Committed: Mon Jun 30 14:59:11 2003 UTC (20 years, 10 months ago) by schorsch
Content type: text/plain
Branch: MAIN
Changes since 3.4: +29 -27 lines
Log Message:
Replaced most outdated BSD function calls with their posix equivalents, and cleaned up a few other platform dependencies.

File Contents

# User Rev Content
1 schorsch 3.5 /* RCSid $Id: platform.h,v 3.4 2003/06/27 06:53:21 greg 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     #include <fcntl.h> /* _O_BINARY, _O_TEXT */
17     #include <io.h> /* _setmode() */
18     #include <stdlib.h> /* _fmode */
19    
20     #define NON_POSIX
21     #define RHAS_ACCESS
22    
23     #define SET_DEFAULT_BINARY() _fmode = _O_BINARY
24     #define SET_FILE_BINARY(fp) _setmode(fileno(fp),_O_BINARY)
25     #define SET_FD_BINARY(fd) _setmode(fd,_O_BINARY)
26 schorsch 3.1
27     #else /* _WIN32 */
28    
29 schorsch 3.5 #ifdef AMIGA
30     #define NON_POSIX
31     #else
32     /* assumedly posix systems */
33     #define RHAS_GETPWNAM
34     #define RHAS_ACCESS
35     #define RHAS_FORK_EXEC
36     #endif
37    
38     /* everybody except Windows */
39    
40     /* NOPs */
41     #define SET_DEFAULT_BINARY()
42     #define SET_FILE_BINARY(fp)
43     #define SET_FD_BINARY(fd)
44 schorsch 3.1
45     #endif /* _WIN32 */
46    
47 schorsch 3.2
48     #ifdef __cplusplus
49     }
50     #endif
51 schorsch 3.1 #endif /* _RAD_PLATFORM_H_ */
52