ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/platform.h
Revision: 3.8
Committed: Mon Jul 14 22:23:59 2003 UTC (20 years, 9 months ago) by schorsch
Content type: text/plain
Branch: MAIN
Changes since 3.7: +6 -4 lines
Log Message:
Instrumented headers against multiple inclusion and for use from C++.
Moved includes in headers out of "C" scope.

File Contents

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