Commit | Line | Data |
---|---|---|
ab62d049 | 1 | /* Mac MPW host-specific definitions. */ |
848743c1 | 2 | |
d60e8a54 | 3 | #ifndef hosts_mpw_H |
848743c1 | 4 | #define hosts_mpw_H |
d60e8a54 SS |
5 | |
6 | #ifndef MPW | |
7 | #define MPW | |
8 | #endif | |
9 | ||
10 | /* MPW C is basically ANSI, but doesn't actually enable __STDC__, | |
11 | nor does it allow __STDC__ to be #defined. */ | |
12 | ||
13 | #ifndef ALMOST_STDC | |
14 | #define ALMOST_STDC | |
15 | #endif | |
16 | ||
ab62d049 SS |
17 | /* This bit of ugliness works around the stupid and useless definitions |
18 | of true and false in BFD header files. */ | |
19 | ||
d60e8a54 SS |
20 | #ifdef BFD_TRUE_FALSE |
21 | #ifndef false | |
22 | #define false mpw_false | |
23 | #endif | |
24 | #ifndef true | |
25 | #define true mpw_true | |
26 | #endif | |
27 | #endif | |
28 | ||
29 | #include <stdlib.h> | |
30 | #include <errno.h> | |
31 | #include <stdio.h> | |
32 | #include <ctype.h> | |
33 | #include <string.h> | |
d60e8a54 SS |
34 | #include <fcntl.h> |
35 | ||
848743c1 SS |
36 | #include <sys/stat.h> |
37 | ||
d60e8a54 SS |
38 | #ifndef O_ACCMODE |
39 | #define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR) | |
40 | #endif | |
d60e8a54 SS |
41 | |
42 | /* Binary files have different characteristics; for instance, no cr/nl | |
43 | translation. */ | |
44 | ||
45 | #include "fopen-bin.h" | |
46 | ||
47 | #include <stddef.h> | |
48 | ||
223e8306 SS |
49 | #include <spin.h> |
50 | ||
d60e8a54 SS |
51 | #ifdef MPW_C |
52 | ||
53 | #undef __PTR_TO_INT | |
54 | #define __PTR_TO_INT(P) ((int)(P)) | |
55 | #undef __INT_TO_PTR | |
56 | #define __INT_TO_PTR(P) ((char *)(P)) | |
57 | ||
58 | #endif | |
59 | ||
d60e8a54 SS |
60 | #define NO_FCNTL |
61 | ||
30d7f715 SS |
62 | int fstat (); |
63 | ||
d60e8a54 | 64 | FILE *mpw_fopen (); |
d60e8a54 | 65 | int mpw_fseek (); |
ab62d049 SS |
66 | int mpw_fread (); |
67 | int mpw_fwrite (); | |
d60e8a54 SS |
68 | void mpw_abort (); |
69 | ||
70 | /* Map these standard functions to improved versions in libiberty. */ | |
71 | ||
72 | #define fopen mpw_fopen | |
d60e8a54 | 73 | #define fseek mpw_fseek |
ab62d049 SS |
74 | #define fread mpw_fread |
75 | #define fwrite mpw_fwrite | |
d60e8a54 SS |
76 | #define abort mpw_abort |
77 | ||
848743c1 | 78 | #ifndef TRUE_FALSE_ALREADY_DEFINED |
d60e8a54 | 79 | #define TRUE_FALSE_ALREADY_DEFINED |
848743c1 SS |
80 | #endif |
81 | ||
82 | #define POSIX_UTIME | |
d60e8a54 SS |
83 | |
84 | #define LOSING_TOTALLY | |
85 | ||
117dbbc6 SS |
86 | /* Define this so that files will be closed before being unlinked. */ |
87 | ||
88 | #define CLOSE_BEFORE_UNLINK | |
89 | ||
848743c1 | 90 | #endif /* hosts_mpw_H */ |