| 1 |
greg |
3.4 |
/* RCSid $Id: platform.h,v 3.3 2003/06/08 12:03:09 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.3 |
#include <stdio.h> |
| 14 |
|
|
#define popen _popen |
| 15 |
|
|
#define pclose _pclose |
| 16 |
schorsch |
3.1 |
#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 |
schorsch |
3.2 |
|
| 46 |
|
|
#ifdef __cplusplus |
| 47 |
|
|
} |
| 48 |
|
|
#endif |
| 49 |
schorsch |
3.1 |
#endif /* _RAD_PLATFORM_H_ */ |
| 50 |
|
|
|