2 |
|
/* |
3 |
|
* platform.h - header file for platform specific definitions |
4 |
|
*/ |
5 |
– |
|
6 |
– |
#include "copyright.h" |
7 |
– |
|
8 |
– |
|
5 |
|
#ifndef _RAD_PLATFORM_H_ |
6 |
|
#define _RAD_PLATFORM_H_ |
7 |
+ |
#ifdef __cplusplus |
8 |
+ |
extern "C" { |
9 |
+ |
#endif |
10 |
|
|
12 |
– |
|
11 |
|
#ifdef _WIN32 |
12 |
|
|
13 |
< |
#include <stdio.h> /* fileno() */ |
14 |
< |
#include <fcntl.h> /* _O_BINARY, _O_TEXT */ |
15 |
< |
#include <io.h> /* _setmode() */ |
18 |
< |
#include <stdlib.h> /* _fmode */ |
13 |
> |
#include <stdio.h> |
14 |
> |
#define popen _popen |
15 |
> |
#define pclose _pclose |
16 |
|
|
17 |
< |
#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) |
17 |
> |
#define NON_POSIX |
18 |
|
|
19 |
+ |
#include <sys/types.h> |
20 |
+ |
#include <sys/stat.h> |
21 |
+ |
#define RHAS_STAT |
22 |
+ |
#define S_IFREG _S_IFREG |
23 |
+ |
#define W_IFDIR _S_IFDIR |
24 |
|
|
25 |
+ |
#include <fcntl.h> /* _O_BINARY, _O_TEXT */ |
26 |
+ |
#include <io.h> /* _setmode() */ |
27 |
+ |
#include <stdlib.h> /* _fmode */ |
28 |
+ |
#define SET_DEFAULT_BINARY() _fmode = _O_BINARY |
29 |
+ |
#define SET_FILE_BINARY(fp) _setmode(fileno(fp),_O_BINARY) |
30 |
+ |
#define SET_FD_BINARY(fd) _setmode(fd,_O_BINARY) |
31 |
|
|
26 |
– |
|
27 |
– |
|
28 |
– |
|
29 |
– |
|
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) |
34 |
> |
#ifdef AMIGA |
35 |
> |
#define NON_POSIX |
36 |
> |
#else |
37 |
> |
/* assumedly posix systems */ |
38 |
> |
#define RHAS_GETPWNAM |
39 |
> |
#define RHAS_STAT |
40 |
> |
#define RHAS_FORK_EXEC |
41 |
> |
#endif |
42 |
|
|
43 |
+ |
/* everybody except Windows */ |
44 |
|
|
45 |
+ |
/* NOPs */ |
46 |
+ |
#define SET_DEFAULT_BINARY() |
47 |
+ |
#define SET_FILE_BINARY(fp) |
48 |
+ |
#define SET_FD_BINARY(fd) |
49 |
|
|
39 |
– |
|
40 |
– |
|
41 |
– |
|
42 |
– |
|
50 |
|
#endif /* _WIN32 */ |
51 |
|
|
52 |
+ |
|
53 |
+ |
#ifdef __cplusplus |
54 |
+ |
} |
55 |
+ |
#endif |
56 |
|
#endif /* _RAD_PLATFORM_H_ */ |
57 |
|
|