Commit | Line | Data |
---|---|---|
3db64b00 | 1 | /* sysdep.h -- handle host dependencies for binutils |
250d07de | 2 | Copyright (C) 1991-2021 Free Software Foundation, Inc. |
3db64b00 AM |
3 | |
4 | This file is part of GNU Binutils. | |
5 | ||
6 | This program is free software; you can redistribute it and/or modify | |
7 | it under the terms of the GNU General Public License as published by | |
32866df7 | 8 | the Free Software Foundation; either version 3 of the License, or |
3db64b00 AM |
9 | (at your option) any later version. |
10 | ||
11 | This program is distributed in the hope that it will be useful, | |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | GNU General Public License for more details. | |
15 | ||
16 | You should have received a copy of the GNU General Public License | |
17 | along with this program; if not, write to the Free Software | |
18 | Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ | |
19 | \f | |
20 | #ifndef _BIN_SYSDEP_H | |
21 | #define _BIN_SYSDEP_H | |
22 | ||
87b9f255 | 23 | #include "config.h" |
3db64b00 | 24 | #include <stdio.h> |
87b9f255 | 25 | #ifdef HAVE_SYS_TYPES_H |
3db64b00 | 26 | #include <sys/types.h> |
3db64b00 | 27 | #endif |
87b9f255 AM |
28 | #ifdef HAVE_SYS_STAT_H |
29 | #include <sys/stat.h> | |
3db64b00 | 30 | #endif |
87b9f255 AM |
31 | #include <stdlib.h> |
32 | #include <string.h> | |
33 | #include <stdarg.h> | |
34 | #include <errno.h> | |
3db64b00 AM |
35 | #ifdef HAVE_UNISTD_H |
36 | #include <unistd.h> | |
37 | #endif | |
3db64b00 AM |
38 | #ifdef HAVE_FCNTL_H |
39 | #include <fcntl.h> | |
40 | #else | |
41 | #ifdef HAVE_SYS_FILE_H | |
42 | #include <sys/file.h> | |
43 | #endif | |
44 | #endif | |
45 | ||
87b9f255 AM |
46 | #include "ansidecl.h" |
47 | #include "bfdver.h" | |
48 | ||
49 | #ifdef USE_BINARY_FOPEN | |
50 | #include "fopen-bin.h" | |
51 | #else | |
52 | #include "fopen-same.h" | |
dbb7c441 AM |
53 | #endif |
54 | ||
4cef8a9f AM |
55 | #include "binary-io.h" |
56 | ||
3db64b00 AM |
57 | #if !HAVE_DECL_STPCPY |
58 | extern char *stpcpy (char *, const char *); | |
59 | #endif | |
60 | ||
3db64b00 AM |
61 | #ifdef HAVE_SBRK |
62 | #if !HAVE_DECL_SBRK | |
63 | extern char *sbrk (); | |
64 | #endif | |
65 | #endif | |
66 | ||
3db64b00 AM |
67 | #if !HAVE_DECL_ENVIRON |
68 | extern char **environ; | |
69 | #endif | |
70 | ||
3db64b00 AM |
71 | #ifndef O_RDONLY |
72 | #define O_RDONLY 0 | |
73 | #endif | |
74 | ||
75 | #ifndef O_RDWR | |
76 | #define O_RDWR 2 | |
77 | #endif | |
78 | ||
79 | #ifndef SEEK_SET | |
80 | #define SEEK_SET 0 | |
81 | #endif | |
82 | #ifndef SEEK_CUR | |
83 | #define SEEK_CUR 1 | |
84 | #endif | |
85 | #ifndef SEEK_END | |
86 | #define SEEK_END 2 | |
87 | #endif | |
88 | ||
87b9f255 AM |
89 | #ifndef ENABLE_NLS |
90 | /* The Solaris version of locale.h always includes libintl.h. If we have | |
91 | been configured with --disable-nls then ENABLE_NLS will not be defined | |
92 | and the dummy definitions of bindtextdomain (et al) below will conflict | |
93 | with the defintions in libintl.h. So we define these values to prevent | |
94 | the bogus inclusion of libintl.h. */ | |
95 | # define _LIBINTL_H | |
96 | # define _LIBGETTEXT_H | |
3db64b00 | 97 | #endif |
87b9f255 | 98 | #include <locale.h> |
3db64b00 AM |
99 | |
100 | #ifdef ENABLE_NLS | |
101 | # include <libintl.h> | |
102 | # define _(String) gettext (String) | |
103 | # ifdef gettext_noop | |
104 | # define N_(String) gettext_noop (String) | |
105 | # else | |
106 | # define N_(String) (String) | |
107 | # endif | |
108 | #else | |
109 | # define gettext(Msgid) (Msgid) | |
110 | # define dgettext(Domainname, Msgid) (Msgid) | |
111 | # define dcgettext(Domainname, Msgid, Category) (Msgid) | |
6003e27e AM |
112 | # define ngettext(Msgid1, Msgid2, n) \ |
113 | (n == 1 ? Msgid1 : Msgid2) | |
114 | # define dngettext(Domainname, Msgid1, Msgid2, n) \ | |
115 | (n == 1 ? Msgid1 : Msgid2) | |
116 | # define dcngettext(Domainname, Msgid1, Msgid2, n, Category) \ | |
117 | (n == 1 ? Msgid1 : Msgid2) | |
118 | # define textdomain(Domainname) do {} while (0) | |
119 | # define bindtextdomain(Domainname, Dirname) do {} while (0) | |
3db64b00 AM |
120 | # define _(String) (String) |
121 | # define N_(String) (String) | |
122 | #endif | |
123 | ||
124 | /* Used by ar.c and objcopy.c. */ | |
125 | #define BUFSIZE 8192 | |
126 | ||
0dafdf3f | 127 | #include <limits.h> |
0dafdf3f | 128 | |
87b9f255 | 129 | #if SIZEOF_LONG_LONG > SIZEOF_LONG |
16412c3b AM |
130 | /* We can't use any bfd types here since readelf may define BFD64 and |
131 | objdump may not. */ | |
132 | #define HOST_WIDEST_INT long long | |
133 | #else | |
134 | #define HOST_WIDEST_INT long | |
135 | #endif | |
136 | ||
015dc7e1 AM |
137 | #define POISON_BFD_BOOLEAN 1 |
138 | ||
3db64b00 | 139 | #endif /* _BIN_SYSDEP_H */ |