1 /* sysdep.h -- handle host dependencies for the BFD library
2 Copyright (C) 1995-2024 Free Software Foundation, Inc.
3 Written by Cygnus Support.
5 This file is part of BFD, the Binary File Descriptor library.
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.
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.
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. */
26 #error sysdep.h must be included in lieu of config.h
32 #ifdef HAVE_SYS_TYPES_H
33 #include <sys/types.h>
47 #ifdef HAVE_SYS_RESOURCE_H
48 #include <sys/resource.h>
49 #endif /* HAVE_SYS_RESOURCE_H */
51 #ifdef USE_BINARY_FOPEN
52 #include "fopen-bin.h"
54 #include "fopen-same.h"
60 #ifdef HAVE_SYS_FILE_H
75 #define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
77 /* Systems that don't already define this, don't need it. */
98 #define MAP_FAILED ((void *) -1)
101 #ifndef MAP_ANONYMOUS
102 #define MAP_ANONYMOUS MAP_ANON
105 #include "filenames.h"
108 extern int ffs (int);
111 #if !HAVE_DECL_STPCPY
112 extern char *stpcpy (char *__dest
, const char *__src
);
116 #if !HAVE_DECL_FTELLO
117 extern off_t
ftello (FILE *stream
);
122 #if !HAVE_DECL_FTELLO64
123 extern off64_t
ftello64 (FILE *stream
);
128 #if !HAVE_DECL_FSEEKO
129 extern int fseeko (FILE *stream
, off_t offset
, int whence
);
134 #if !HAVE_DECL_FSEEKO64
135 extern int fseeko64 (FILE *stream
, off64_t offset
, int whence
);
139 /* Define offsetof for those systems which lack it */
142 #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
146 /* The Solaris version of locale.h always includes libintl.h. If we have
147 been configured with --disable-nls then ENABLE_NLS will not be defined
148 and the dummy definitions of bindtextdomain (et al) below will conflict
149 with the defintions in libintl.h. So we define these values to prevent
150 the bogus inclusion of libintl.h. */
152 # define _LIBGETTEXT_H
157 # include <libintl.h>
158 /* Note the redefinition of gettext and ngettext here to use PACKAGE.
160 This is because the code in this directory is used to build a
161 library which will be linked with code in other directories to form
162 programs. We want to maintain a separate translation file for this
163 directory however, rather than being forced to merge it with that
164 of any program linked to libbfd. This is a library, so it cannot
165 depend on the catalog currently loaded.
167 In order to do this, we have to make sure that when we extract
168 messages we use the BFD domain rather than the domain of the
169 program that included the bfd library, (eg OBJDUMP). Hence we use
170 dgettext (PACKAGE, String) and define PACKAGE to be 'bfd'.
171 (See the code in configure). */
173 # define gettext(Msgid) dgettext (PACKAGE, Msgid)
175 # define ngettext(Msgid1, Msgid2, n) dngettext (PACKAGE, Msgid1, Msgid2, n)
176 # define _(String) gettext (String)
178 # define N_(String) gettext_noop (String)
180 # define N_(String) (String)
183 # define gettext(Msgid) (Msgid)
184 # define dgettext(Domainname, Msgid) (Msgid)
185 # define dcgettext(Domainname, Msgid, Category) (Msgid)
186 # define ngettext(Msgid1, Msgid2, n) \
187 (n == 1 ? Msgid1 : Msgid2)
188 # define dngettext(Domainname, Msgid1, Msgid2, n) \
189 (n == 1 ? Msgid1 : Msgid2)
190 # define dcngettext(Domainname, Msgid1, Msgid2, n, Category) \
191 (n == 1 ? Msgid1 : Msgid2)
192 # define textdomain(Domainname) do {} while (0)
193 # define bindtextdomain(Domainname, Dirname) do {} while (0)
194 # define _(String) (String)
195 # define N_(String) (String)
206 #define POISON_BFD_BOOLEAN 1
208 #endif /* ! defined (BFD_SYSDEP_H) */