ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/platform.h
Revision: 3.3
Committed: Sun Jun 8 12:03:09 2003 UTC (20 years, 10 months ago) by schorsch
Content type: text/plain
Branch: MAIN
Changes since 3.2: +4 -2 lines
Log Message:
Reduced compile warnings/errors on Windows.

File Contents

# User Rev Content
1 schorsch 3.3 /* RCSid $Id: platform.h,v 3.2 2003/06/06 16:38:47 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 schorsch 3.2 #include "copyright.h"
12 schorsch 3.1
13     #ifdef _WIN32
14    
15 schorsch 3.3 #include <stdio.h>
16     #define popen _popen
17     #define pclose _pclose
18 schorsch 3.1 #include <fcntl.h> /* _O_BINARY, _O_TEXT */
19     #include <io.h> /* _setmode() */
20     #include <stdlib.h> /* _fmode */
21    
22     #define SET_DEFAULT_BINARY() _fmode = _O_BINARY
23     #define SET_FILE_BINARY(fp) _setmode(fileno(fp),_O_BINARY)
24     #define SET_FD_BINARY(fd) _setmode(fd,_O_BINARY)
25    
26    
27    
28    
29    
30    
31    
32     #else /* _WIN32 */
33    
34     /* NOPs on unix */
35     #define SET_DEFAULT_BINARY()
36     #define SET_FILE_BINARY(fp)
37     #define SET_FD_BINARY(fd)
38    
39    
40    
41    
42    
43    
44    
45     #endif /* _WIN32 */
46    
47 schorsch 3.2
48     #ifdef __cplusplus
49     }
50     #endif
51 schorsch 3.1 #endif /* _RAD_PLATFORM_H_ */
52