1 |
/* RCSid $Id: platform.h,v 3.1 2003/06/05 19:29:34 schorsch 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 |
#include "copyright.h" |
12 |
|
13 |
#ifdef _WIN32 |
14 |
|
15 |
#include <stdio.h> /* fileno() */ |
16 |
#include <fcntl.h> /* _O_BINARY, _O_TEXT */ |
17 |
#include <io.h> /* _setmode() */ |
18 |
#include <stdlib.h> /* _fmode */ |
19 |
|
20 |
#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) |
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
#else /* _WIN32 */ |
31 |
|
32 |
/* NOPs on unix */ |
33 |
#define SET_DEFAULT_BINARY() |
34 |
#define SET_FILE_BINARY(fp) |
35 |
#define SET_FD_BINARY(fd) |
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
#endif /* _WIN32 */ |
44 |
|
45 |
|
46 |
#ifdef __cplusplus |
47 |
} |
48 |
#endif |
49 |
#endif /* _RAD_PLATFORM_H_ */ |
50 |
|