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