ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/platform.h
Revision: 3.1
Committed: Thu Jun 5 19:29:34 2003 UTC (20 years, 10 months ago) by schorsch
Content type: text/plain
Branch: MAIN
Log Message:
Macros for setting binary file mode. Replacing MSDOS by _WIN32.

File Contents

# User Rev Content
1 schorsch 3.1 /* RCSid $Id$ */
2     /*
3     * platform.h - header file for platform specific definitions
4     */
5    
6     #include "copyright.h"
7    
8    
9     #ifndef _RAD_PLATFORM_H_
10     #define _RAD_PLATFORM_H_
11    
12    
13     #ifdef _WIN32
14    
15     #include <stdio.h> /* fileno() */
16     #include <fcntl.h> /* _O_BINARY, _O_TEXT */
17     #include <io.h> /* _setmode() */
18     #include <stdlib.h> /* _fmode */
19    
20     #define SET_DEFAULT_BINARY() _fmode = _O_BINARY
21     #define SET_FILE_BINARY(fp) _setmode(fileno(fp),_O_BINARY)
22     #define SET_FD_BINARY(fd) _setmode(fd,_O_BINARY)
23    
24    
25    
26    
27    
28    
29    
30     #else /* _WIN32 */
31    
32     /* NOPs on unix */
33     #define SET_DEFAULT_BINARY()
34     #define SET_FILE_BINARY(fp)
35     #define SET_FD_BINARY(fd)
36    
37    
38    
39    
40    
41    
42    
43     #endif /* _WIN32 */
44    
45     #endif /* _RAD_PLATFORM_H_ */
46