Add #include <alloca.h> so bfd can be built with native compiler.
[deliverable/binutils-gdb.git] / bfd / hosts / sparc.h
CommitLineData
e4a0e98e
SC
1#include <fcntl.h>
2#include <errno.h>
3#include <stdio.h>
4#include <sys/types.h>
5#include <sys/stat.h>
6#include <ctype.h>
7#include <string.h>
8#include <sys/file.h>
dd6cc3c9 9#include <alloca.h>
e4a0e98e
SC
10#ifndef O_ACCMODE
11#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
12#endif
13#define SEEK_SET 0
14#define SEEK_CUR 1
cb467682 15#ifdef __STDC__
458c4827
KR
16#if __GNUC__ >= 2
17#define abort __hide_abort
18#define exit __hide_exit
19#endif
cb467682 20#include <stdlib.h>
458c4827
KR
21#undef exit
22#undef abort
cb467682
SC
23#include <string.h>
24#else
302c8ab1
SC
25extern char *EXFUN(mktemp,(CONST char*));
26extern int EXFUN(fflush,(FILE *));
27extern int EXFUN(write,(int, CONST char *, int));
28extern int EXFUN(index,(CONST char *, char c));
29extern void EXFUN(abort,(void));
30extern int EXFUN(close,(int));
31extern int EXFUN(fcntl,(int des, int cmd, int e));
32extern int EXFUN(fprintf,(FILE *,char *,...));
33extern int EXFUN(printf,(char *,...));
34extern int EXFUN(qsort,(void *data,int els, int siz, int func()));
35extern void EXFUN(exit,(int));
36extern int EXFUN(fseek,(FILE*, int, int));
37extern int EXFUN(fclose,(FILE*));
38extern void EXFUN(bcopy,(char*,char*,int));
39extern int EXFUN(bcmp,(char *, char *, int));
40extern void EXFUN(bzero,(char *, int));
41extern PTR EXFUN(memset,(PTR, int, int));
42extern void EXFUN(puts,(CONST char*));
43extern void EXFUN(fputs,(CONST char*,FILE*));
44extern int EXFUN(rmdir,(CONST char *));
45extern int EXFUN(getuid,(void));
46extern int EXFUN(getgid,(void));
47extern int EXFUN(rename,(CONST char *, CONST char*));
48extern int EXFUN(etuid,());
49extern int EXFUN(etgid,());
50extern void EXFUN(perror,(CONST char *));
51#ifndef DONTDECLARE_MALLOC
52extern PTR EXFUN(malloc,(unsigned));
53extern PTR EXFUN(realloc, (PTR, unsigned));
54#endif
55
d25efc25 56#ifndef __GNUC__
302c8ab1 57extern PTR EXFUN(memcpy,(PTR,CONST PTR,unsigned int));
d25efc25 58#else
56a56f4c 59/* char * EXFUN( memcpy,(char *,CONST char *,unsigned int)); */
d25efc25
SC
60#endif
61
147a251a 62
e4a0e98e 63extern char * strchr();
e4a0e98e
SC
64extern char *getenv();
65extern char *memchr();
66extern char *strrchr();
67extern int chmod();
68extern int fread();
69extern int fstat();
70extern int fwrite();
71extern int sscanf();
72extern int stat();
73extern int strtol();
179ca8db 74extern int EXFUN(free,(PTR));
19b03b7a 75
ac677dad 76
e4a0e98e
SC
77extern char *strrchr();
78extern char *ctime();
79extern int _flsbuf();
80extern int fclose();
81extern int time();
82extern int utimes();
83extern int vfprintf();
84extern long atol();
85extern char *getenv();
86extern int fputc();
87extern int unlink();
cb467682 88#endif /* __STDC__ */
e4a0e98e
SC
89
90/* EXACT TYPES */
91typedef char int8e_type;
92typedef unsigned char uint8e_type;
93typedef short int16e_type;
94typedef unsigned short uint16e_type;
95typedef int int32e_type;
96typedef unsigned int uint32e_type;
97
19b03b7a
SC
98
99#ifdef __GNUC__
100typedef unsigned long long uint64e_type;
101
102#else
103typedef struct {
104 uint32e_type low, high;
105} uint64e_type;
106
107#endif
e4a0e98e
SC
108/* CORRECT SIZE OR GREATER */
109typedef char int8_type;
110typedef unsigned char uint8_type;
111typedef short int16_type;
112typedef unsigned short uint16_type;
113typedef int int32_type;
114typedef unsigned int uint32_type;
115
19b03b7a
SC
116#ifdef __GNUC__
117typedef unsigned long long uint64_type;
118typedef long long int64_type;
119#else
120typedef struct {
121 uint32e_type low, high;
122} uint64_type;
123
124typedef struct {
125 uint32e_type low, high;
126} int64_type;
127
128#endif
129
130
131#define BYTES_IN_PRINTF_INT 4
132#ifndef __GNUC__
133#define uint64_typeLOW(x) (uint32_type)(((x).low))
134#define uint64_typeHIGH(x) (uint32_type)(((x).high))
135#else
136#define uint64_typeLOW(x) (uint32_type)(((x) & 0xffffffff))
137#define uint64_typeHIGH(x) (uint32_type)(((x) >> 32) & 0xffffffff)
138#endif
147a251a
SC
139
140
a5431adc 141#include "fopen-same.h"
This page took 0.05332 seconds and 4 git commands to generate.