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