Commit | Line | Data |
---|---|---|
2c3f93e5 JG |
1 | /* Host definition file for Sun-4 running with gcc, using "long long" |
2 | for addresses, to handle 64-bit target systems. */ | |
3 | ||
4 | #include <fcntl.h> | |
5 | #include <errno.h> | |
6 | #include <stdio.h> | |
7 | #include <sys/types.h> | |
8 | #include <sys/stat.h> | |
9 | #include <ctype.h> | |
10 | #include <string.h> | |
11 | #include <sys/file.h> | |
dd6cc3c9 | 12 | #include <alloca.h> |
2c3f93e5 JG |
13 | #ifndef O_ACCMODE |
14 | #define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR) | |
15 | #endif | |
16 | #define SEEK_SET 0 | |
17 | #define SEEK_CUR 1 | |
18 | ||
19 | /* Make the basic types 64-bit quantities on the host */ | |
20 | #define HOST_64_BIT long long | |
21 | ||
302c8ab1 SC |
22 | extern int EXFUN(abort,(void)); |
23 | extern int EXFUN(close,(int)); | |
24 | extern int EXFUN(fcntl,(int des, int cmd, int e)); | |
25 | extern int EXFUN(fprintf,(FILE *,char *,...)); | |
26 | extern int EXFUN(printf,(char *,...)); | |
27 | extern int EXFUN(qsort,(void *data,int els, int siz, int func())); | |
28 | extern void EXFUN(exit,(int)); | |
29 | extern int EXFUN(fseek,(FILE*, int, int)); | |
30 | extern int EXFUN(fclose,(FILE*)); | |
31 | extern void EXFUN(bcopy,(char*,char*,int)); | |
32 | extern int EXFUN(bcmp,(char *, char *, int)); | |
33 | extern void EXFUN(bzero,(char *, int)); | |
34 | extern PTR EXFUN(memset,(PTR, int,unsigned int)); | |
35 | #ifndef DONTDECLARE_MALLOC | |
36 | extern PTR EXFUN(malloc,(unsigned)); | |
37 | extern PTR EXFUN(realloc, (PTR, unsigned)); | |
38 | #endif | |
39 | ||
2c3f93e5 | 40 | #ifndef __GNUC__ |
302c8ab1 | 41 | PTR EXFUN(memcpy,(PTR,CONST PTR,unsigned int)); |
2c3f93e5 | 42 | #else |
302c8ab1 | 43 | /* char * EXFUN(memcpy,(char *,CONST char *,unsigned int)); */ |
2c3f93e5 JG |
44 | #endif |
45 | ||
56a56f4c SC |
46 | extern int EXFUN(getuid,()); |
47 | extern int EXFUN(getgid,()); | |
2c3f93e5 | 48 | extern char * strchr(); |
302c8ab1 | 49 | extern void EXFUN(perror,(CONST char *)); |
2c3f93e5 JG |
50 | extern char *getenv(); |
51 | extern char *memchr(); | |
52 | extern char *strrchr(); | |
53 | extern int chmod(); | |
54 | extern int fread(); | |
55 | extern int fstat(); | |
56 | extern int fwrite(); | |
57 | extern int sscanf(); | |
58 | extern int stat(); | |
59 | extern int strtol(); | |
2c3f93e5 | 60 | |
302c8ab1 | 61 | extern int EXFUN(free,(PTR)); |
2c3f93e5 JG |
62 | |
63 | ||
64 | extern char *strrchr(); | |
65 | extern char *ctime(); | |
66 | extern int _flsbuf(); | |
67 | extern int fclose(); | |
68 | extern int time(); | |
69 | extern int utimes(); | |
70 | extern int vfprintf(); | |
71 | extern long atol(); | |
72 | extern char *getenv(); | |
73 | extern int fputc(); | |
74 | extern int unlink(); | |
75 | ||
76 | ||
2c3f93e5 JG |
77 | #ifdef __GNUC__ |
78 | typedef unsigned long long uint64e_type; | |
79 | ||
80 | #else | |
81 | typedef struct { | |
933ae8d4 | 82 | unsigned long low, high; |
2c3f93e5 JG |
83 | } uint64e_type; |
84 | ||
85 | #endif | |
2c3f93e5 JG |
86 | |
87 | #ifdef __GNUC__ | |
88 | typedef unsigned long long uint64_type; | |
89 | typedef long long int64_type; | |
90 | #else | |
91 | typedef struct { | |
933ae8d4 | 92 | unsigned long low, high; |
2c3f93e5 JG |
93 | } uint64_type; |
94 | ||
95 | typedef struct { | |
933ae8d4 | 96 | unsigned long low, high; |
2c3f93e5 JG |
97 | } int64_type; |
98 | ||
99 | #endif | |
100 | ||
2c3f93e5 JG |
101 | #define BYTES_IN_PRINTF_INT 4 |
102 | #ifndef __GNUC__ | |
933ae8d4 JG |
103 | #define uint64_typeLOW(x) (unsigned long)(((x).low)) |
104 | #define uint64_typeHIGH(x) (unsigned long)(((x).high)) | |
2c3f93e5 | 105 | #else |
933ae8d4 JG |
106 | #define uint64_typeLOW(x) (unsigned long)(((x) & 0xffffffff)) |
107 | #define uint64_typeHIGH(x) (unsigned long)(((x) >> 32) & 0xffffffff) | |
2c3f93e5 | 108 | #endif |
933ae8d4 | 109 | |
a5431adc | 110 | #include "fopen-same.h" |