1 |
/* RCSid $Id: platform.h,v 3.4 2003/06/27 06:53:21 greg 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 <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 |
|
27 |
#else /* _WIN32 */ |
28 |
|
29 |
#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 |
|
45 |
#endif /* _WIN32 */ |
46 |
|
47 |
|
48 |
#ifdef __cplusplus |
49 |
} |
50 |
#endif |
51 |
#endif /* _RAD_PLATFORM_H_ */ |
52 |
|