Rev 5199 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
5197 | serge | 1 | /* sysdep.h -- handle host dependencies for the BFD library |
6324 | serge | 2 | Copyright (C) 1995-2015 Free Software Foundation, Inc. |
5197 | serge | 3 | Written by Cygnus Support. |
4 | |||
5 | This file is part of BFD, the Binary File Descriptor library. |
||
6 | |||
7 | This program is free software; you can redistribute it and/or modify |
||
8 | it under the terms of the GNU General Public License as published by |
||
9 | the Free Software Foundation; either version 3 of the License, or |
||
10 | (at your option) any later version. |
||
11 | |||
12 | This program is distributed in the hope that it will be useful, |
||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
15 | GNU General Public License for more details. |
||
16 | |||
17 | You should have received a copy of the GNU General Public License |
||
18 | along with this program; if not, write to the Free Software |
||
19 | Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, |
||
20 | MA 02110-1301, USA. */ |
||
21 | |||
22 | #ifndef BFD_SYSDEP_H |
||
23 | #define BFD_SYSDEP_H |
||
24 | |||
25 | #ifdef PACKAGE |
||
26 | #error sysdep.h must be included in lieu of config.h |
||
27 | #endif |
||
28 | |||
29 | #include "config.h" |
||
30 | |||
31 | #include "ansidecl.h" |
||
32 | |||
33 | #ifdef HAVE_STDDEF_H |
||
34 | #include |
||
35 | #endif |
||
36 | |||
6324 | serge | 37 | #include |
38 | |||
5197 | serge | 39 | #include |
40 | #include |
||
41 | #include |
||
42 | |||
43 | #include |
||
44 | #if !(defined(errno) || defined(_MSC_VER) && defined(_INC_ERRNO)) |
||
45 | extern int errno; |
||
46 | #endif |
||
47 | |||
48 | #ifdef STRING_WITH_STRINGS |
||
49 | #include |
||
50 | #include |
||
51 | #else |
||
52 | #ifdef HAVE_STRING_H |
||
53 | #include |
||
54 | #else |
||
55 | #ifdef HAVE_STRINGS_H |
||
56 | #include |
||
57 | #else |
||
58 | extern char *strchr (); |
||
59 | extern char *strrchr (); |
||
60 | #endif |
||
61 | #endif |
||
62 | #endif |
||
63 | |||
64 | #ifdef HAVE_STDLIB_H |
||
65 | #include |
||
66 | #endif |
||
67 | |||
68 | #ifdef TIME_WITH_SYS_TIME |
||
69 | #include |
||
70 | #include |
||
71 | #else |
||
72 | #ifdef HAVE_SYS_TIME_H |
||
73 | #include |
||
74 | #else |
||
75 | #include |
||
76 | #endif |
||
77 | #endif |
||
78 | |||
79 | #ifdef HAVE_UNISTD_H |
||
80 | #include |
||
81 | #endif |
||
82 | |||
83 | #ifdef HAVE_SYS_RESOURCE_H |
||
84 | #include |
||
85 | #endif /* HAVE_SYS_RESOURCE_H */ |
||
86 | |||
87 | #ifdef USE_BINARY_FOPEN |
||
88 | #include "fopen-bin.h" |
||
89 | #else |
||
90 | #include "fopen-same.h" |
||
91 | #endif |
||
92 | |||
93 | #ifdef HAVE_FCNTL_H |
||
94 | #include |
||
95 | #else |
||
96 | #ifdef HAVE_SYS_FILE_H |
||
97 | #include |
||
98 | #endif |
||
99 | #endif |
||
100 | |||
101 | #ifndef O_RDONLY |
||
102 | #define O_RDONLY 0 |
||
103 | #endif |
||
104 | #ifndef O_WRONLY |
||
105 | #define O_WRONLY 1 |
||
106 | #endif |
||
107 | #ifndef O_RDWR |
||
108 | #define O_RDWR 2 |
||
109 | #endif |
||
110 | #ifndef O_ACCMODE |
||
111 | #define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR) |
||
112 | #endif |
||
113 | |||
114 | #ifndef SEEK_SET |
||
115 | #define SEEK_SET 0 |
||
116 | #endif |
||
117 | #ifndef SEEK_CUR |
||
118 | #define SEEK_CUR 1 |
||
119 | #endif |
||
120 | |||
121 | #include "filenames.h" |
||
122 | |||
123 | #if !HAVE_DECL_FFS |
||
124 | extern int ffs (int); |
||
125 | #endif |
||
126 | |||
127 | #if !HAVE_DECL_FREE |
||
128 | extern void free (); |
||
129 | #endif |
||
130 | |||
131 | #if !HAVE_DECL_GETENV |
||
132 | extern char *getenv (); |
||
133 | #endif |
||
134 | |||
135 | #if !HAVE_DECL_MALLOC |
||
136 | extern PTR malloc (); |
||
137 | #endif |
||
138 | |||
139 | #if !HAVE_DECL_REALLOC |
||
140 | extern PTR realloc (); |
||
141 | #endif |
||
142 | |||
143 | #if !HAVE_DECL_STPCPY |
||
144 | extern char *stpcpy (char *__dest, const char *__src); |
||
145 | #endif |
||
146 | |||
147 | #if !HAVE_DECL_STRSTR |
||
148 | extern char *strstr (); |
||
149 | #endif |
||
150 | |||
151 | #ifdef HAVE_FTELLO |
||
152 | #if !HAVE_DECL_FTELLO |
||
153 | extern off_t ftello (FILE *stream); |
||
154 | #endif |
||
155 | #endif |
||
156 | |||
157 | #ifdef HAVE_FTELLO64 |
||
158 | #if !HAVE_DECL_FTELLO64 |
||
159 | extern off64_t ftello64 (FILE *stream); |
||
160 | #endif |
||
161 | #endif |
||
162 | |||
163 | #ifdef HAVE_FSEEKO |
||
164 | #if !HAVE_DECL_FSEEKO |
||
165 | extern int fseeko (FILE *stream, off_t offset, int whence); |
||
166 | #endif |
||
167 | #endif |
||
168 | |||
169 | #ifdef HAVE_FSEEKO64 |
||
170 | #if !HAVE_DECL_FSEEKO64 |
||
171 | extern int fseeko64 (FILE *stream, off64_t offset, int whence); |
||
172 | #endif |
||
173 | #endif |
||
174 | |||
6324 | serge | 175 | #if !HAVE_DECL_STRNLEN |
176 | size_t strnlen (const char *, size_t); |
||
177 | #endif |
||
178 | |||
5197 | serge | 179 | /* Define offsetof for those systems which lack it */ |
180 | |||
181 | #ifndef offsetof |
||
182 | #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) |
||
183 | #endif |
||
184 | |||
185 | #ifdef ENABLE_NLS |
||
186 | #include |
||
187 | /* Note the use of dgetext() and PACKAGE here, rather than gettext(). |
||
188 | |||
189 | This is because the code in this directory is used to build a library which |
||
190 | will be linked with code in other directories to form programs. We want to |
||
191 | maintain a seperate translation file for this directory however, rather |
||
192 | than being forced to merge it with that of any program linked to libbfd. |
||
193 | This is a library, so it cannot depend on the catalog currently loaded. |
||
194 | |||
195 | In order to do this, we have to make sure that when we extract messages we |
||
196 | use the OPCODES domain rather than the domain of the program that included |
||
197 | the bfd library, (eg OBJDUMP). Hence we use dgettext (PACKAGE, String) |
||
198 | and define PACKAGE to be 'bfd'. (See the code in configure). */ |
||
199 | #define _(String) dgettext (PACKAGE, String) |
||
200 | #ifdef gettext_noop |
||
201 | #define N_(String) gettext_noop (String) |
||
202 | #else |
||
203 | #define N_(String) (String) |
||
204 | #endif |
||
205 | #else |
||
206 | # define gettext(Msgid) (Msgid) |
||
207 | # define dgettext(Domainname, Msgid) (Msgid) |
||
208 | # define dcgettext(Domainname, Msgid, Category) (Msgid) |
||
209 | # define textdomain(Domainname) while (0) /* nothing */ |
||
210 | # define bindtextdomain(Domainname, Dirname) while (0) /* nothing */ |
||
211 | # define _(String) (String) |
||
212 | # define N_(String) (String) |
||
213 | #endif |
||
214 | |||
215 | #endif /* ! defined (BFD_SYSDEP_H) */ |