ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/platform.h
Revision: 3.7
Committed: Thu Jul 3 22:41:44 2003 UTC (20 years, 9 months ago) by schorsch
Content type: text/plain
Branch: MAIN
Changes since 3.6: +7 -2 lines
Log Message:
Reduced compile problems on Windows.

File Contents

# Content
1 /* RCSid $Id: platform.h,v 3.6 2003/06/30 19:58:37 schorsch Exp $ */
2 /*
3 * platform.h - header file for platform specific definitions
4 */
5 #ifndef _RAD_PLATFORM_H_
6 #define _RAD_PLATFORM_H_
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
10
11 #ifdef _WIN32
12
13 #include <io.h> /* _setmode() and stuff from unistd.h */
14 typedef long off_t;
15
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
37 #else /* _WIN32 */
38
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
55 #endif /* _WIN32 */
56
57
58 #ifdef __cplusplus
59 }
60 #endif
61 #endif /* _RAD_PLATFORM_H_ */
62