8 |
|
extern "C" { |
9 |
|
#endif |
10 |
|
|
11 |
– |
#include "copyright.h" |
12 |
– |
|
11 |
|
#ifdef _WIN32 |
12 |
|
|
13 |
< |
#include <stdio.h> |
14 |
< |
#define popen _popen |
15 |
< |
#define pclose _pclose |
18 |
< |
#include <fcntl.h> /* _O_BINARY, _O_TEXT */ |
19 |
< |
#include <io.h> /* _setmode() */ |
20 |
< |
#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 |
23 |
< |
#define SET_FILE_BINARY(fp) _setmode(fileno(fp),_O_BINARY) |
24 |
< |
#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 |
|
|
28 |
– |
|
29 |
– |
|
30 |
– |
|
31 |
– |
|
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 |
< |
|
46 |
< |
|
47 |
< |
|
48 |
< |
|
45 |
> |
/* NOPs */ |
46 |
> |
#define SET_DEFAULT_BINARY() |
47 |
> |
#define SET_FILE_BINARY(fp) |
48 |
> |
#define SET_FD_BINARY(fd) |
49 |
|
|
50 |
|
#endif /* _WIN32 */ |
51 |
|
|