Mon Jan 3 10:59:28 1994 Stan Shebs (shebs@andros.cygnus.com)
[platform/upstream/binutils.git] / bfd / hosts / mpw.h
1 #ifndef hosts_mpw_H
2
3 #ifndef MPW
4 #define MPW
5 #endif
6
7 /* MPW C is basically ANSI, but doesn't actually enable __STDC__,
8    nor does it allow __STDC__ to be #defined. */
9
10 #ifndef ALMOST_STDC
11 #define ALMOST_STDC
12 #endif
13
14 #ifdef BFD_TRUE_FALSE
15 #ifndef false
16 #define false mpw_false
17 #endif
18 #ifndef true
19 #define true mpw_true
20 #endif
21 #endif
22
23 #include <stdlib.h>
24 #include <errno.h>
25 #include <stdio.h>
26 #include <ctype.h>
27 #include <string.h>
28
29 #include <fcntl.h>
30
31 #ifndef O_ACCMODE
32 #define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
33 #endif
34 #ifndef SEEK_SET
35 #define SEEK_SET 0
36 #endif
37 #ifndef SEEK_CUR
38 #define SEEK_CUR 1
39 #endif
40 /*#include <string.h>*/
41
42 #ifndef BYTES_IN_PRINTF_INT
43 #define BYTES_IN_PRINTF_INT 4
44 #endif
45
46 /* Binary files have different characteristics; for instance, no cr/nl
47    translation. */
48
49 #include "fopen-bin.h"
50
51 #include <stddef.h>
52
53 #ifdef MPW_C
54
55 #undef  __PTR_TO_INT
56 #define __PTR_TO_INT(P) ((int)(P))
57 #undef __INT_TO_PTR
58 #define __INT_TO_PTR(P) ((char *)(P))
59
60 #endif
61
62 typedef short ino_t;
63 typedef short dev_t;
64
65 struct stat {
66         ino_t st_ino;
67         dev_t st_dev;
68         int st_mode;
69         int st_size;
70         int st_uid;
71         int st_gid;
72         int st_mtime;
73 };
74
75 #define S_ISREG(m) (0)
76 #define S_ISDIR(m) (0)
77
78 #define NO_FCNTL
79
80 #ifdef __STDIO__
81 FILE *mpw_fopen ();
82 #endif
83 int mpw_fstat ();
84 int mpw_fseek ();
85 void mpw_abort ();
86
87 /* Map these standard functions to improved versions in libiberty. */
88
89 #define fopen mpw_fopen
90 #define fstat mpw_fstat
91 #define fseek mpw_fseek
92 #define abort mpw_abort
93
94 /* Define as macros so as to mask the previous enum. */
95
96 #ifndef BFD_TRUE_FALSE
97 #ifndef false
98 #define false ffalse
99 #endif
100 #ifndef true
101 #define true ttrue
102 #endif
103 #endif
104
105 #define TRUE_FALSE_ALREADY_DEFINED
106
107 #define LOSING_TOTALLY
108
109 #define hosts_mpw_H
110 #endif