1 |
schorsch |
3.7 |
/* RCSid $Id: platform.h,v 3.6 2003/06/30 19:58:37 schorsch Exp $ */ |
2 |
schorsch |
3.1 |
/* |
3 |
|
|
* platform.h - header file for platform specific definitions |
4 |
|
|
*/ |
5 |
|
|
#ifndef _RAD_PLATFORM_H_ |
6 |
|
|
#define _RAD_PLATFORM_H_ |
7 |
schorsch |
3.2 |
#ifdef __cplusplus |
8 |
|
|
extern "C" { |
9 |
|
|
#endif |
10 |
schorsch |
3.1 |
|
11 |
|
|
#ifdef _WIN32 |
12 |
|
|
|
13 |
schorsch |
3.7 |
#include <io.h> /* _setmode() and stuff from unistd.h */ |
14 |
|
|
typedef long off_t; |
15 |
|
|
|
16 |
schorsch |
3.5 |
#include <stdio.h> |
17 |
|
|
#define popen _popen |
18 |
|
|
#define pclose _pclose |
19 |
schorsch |
3.6 |
|
20 |
schorsch |
3.7 |
#include <windows.h> |
21 |
|
|
#define sleep(s) Sleep(s*1000) |
22 |
|
|
|
23 |
schorsch |
3.6 |
#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 |
schorsch |
3.5 |
#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 |
schorsch |
3.1 |
|
37 |
|
|
#else /* _WIN32 */ |
38 |
|
|
|
39 |
schorsch |
3.5 |
#ifdef AMIGA |
40 |
|
|
#define NON_POSIX |
41 |
|
|
#else |
42 |
|
|
/* assumedly posix systems */ |
43 |
|
|
#define RHAS_GETPWNAM |
44 |
schorsch |
3.6 |
#define RHAS_STAT |
45 |
schorsch |
3.5 |
#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 |
schorsch |
3.1 |
|
55 |
|
|
#endif /* _WIN32 */ |
56 |
|
|
|
57 |
schorsch |
3.2 |
|
58 |
|
|
#ifdef __cplusplus |
59 |
|
|
} |
60 |
|
|
#endif |
61 |
schorsch |
3.1 |
#endif /* _RAD_PLATFORM_H_ */ |
62 |
|
|
|