1 | /* sysdep.h -- handle host dependencies for the BFD library
|
---|
2 | Copyright 1995, 1996, 1997, 1998, 1999, 2000
|
---|
3 | Free Software Foundation, Inc.
|
---|
4 | Written by Cygnus Support.
|
---|
5 |
|
---|
6 | This file is part of BFD, the Binary File Descriptor library.
|
---|
7 |
|
---|
8 | This program is free software; you can redistribute it and/or modify
|
---|
9 | it under the terms of the GNU General Public License as published by
|
---|
10 | the Free Software Foundation; either version 2 of the License, or
|
---|
11 | (at your option) any later version.
|
---|
12 |
|
---|
13 | This program is distributed in the hope that it will be useful,
|
---|
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
16 | GNU General Public License for more details.
|
---|
17 |
|
---|
18 | You should have received a copy of the GNU General Public License
|
---|
19 | along with this program; if not, write to the Free Software
|
---|
20 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
---|
21 |
|
---|
22 | #ifndef BFD_SYSDEP_H
|
---|
23 | #define BFD_SYSDEP_H
|
---|
24 |
|
---|
25 | #include "ansidecl.h"
|
---|
26 |
|
---|
27 | #include "config.h"
|
---|
28 |
|
---|
29 | #ifdef __EMX__ /* r=bird: hmm seen this before. */
|
---|
30 | #ifdef TRAD_HEADER
|
---|
31 | #include TRAD_HEADER
|
---|
32 | #endif
|
---|
33 | #endif /* __EMX__ */
|
---|
34 |
|
---|
35 | #ifdef HAVE_STDDEF_H
|
---|
36 | #include <stddef.h>
|
---|
37 | #endif
|
---|
38 |
|
---|
39 | #include <stdio.h>
|
---|
40 | #include <sys/types.h>
|
---|
41 | #include <sys/stat.h>
|
---|
42 |
|
---|
43 | #include <errno.h>
|
---|
44 | #if !(defined(errno) || defined(_MSC_VER) && defined(_INC_ERRNO))
|
---|
45 | extern int errno;
|
---|
46 | #endif
|
---|
47 |
|
---|
48 | #ifdef HAVE_STRING_H
|
---|
49 | #include <string.h>
|
---|
50 | #else
|
---|
51 | #ifdef HAVE_STRINGS_H
|
---|
52 | #include <strings.h>
|
---|
53 | #else
|
---|
54 | extern char *strchr ();
|
---|
55 | extern char *strrchr ();
|
---|
56 | #endif
|
---|
57 | #endif
|
---|
58 |
|
---|
59 | #ifdef HAVE_STDLIB_H
|
---|
60 | #include <stdlib.h>
|
---|
61 | #endif
|
---|
62 |
|
---|
63 | #ifdef TIME_WITH_SYS_TIME
|
---|
64 | #include <sys/time.h>
|
---|
65 | #include <time.h>
|
---|
66 | #else
|
---|
67 | #ifdef HAVE_SYS_TIME_H
|
---|
68 | #include <sys/time.h>
|
---|
69 | #else
|
---|
70 | #include <time.h>
|
---|
71 | #endif
|
---|
72 | #endif
|
---|
73 |
|
---|
74 | #ifdef HAVE_UNISTD_H
|
---|
75 | #include <unistd.h>
|
---|
76 | #endif
|
---|
77 |
|
---|
78 | #ifdef USE_BINARY_FOPEN
|
---|
79 | #include "fopen-bin.h"
|
---|
80 | #else
|
---|
81 | #include "fopen-same.h"
|
---|
82 | #endif
|
---|
83 |
|
---|
84 | #ifdef HAVE_FCNTL_H
|
---|
85 | #include <fcntl.h>
|
---|
86 | #else
|
---|
87 | #ifdef HAVE_SYS_FILE_H
|
---|
88 | #include <sys/file.h>
|
---|
89 | #endif
|
---|
90 | #endif
|
---|
91 |
|
---|
92 | #ifndef O_RDONLY
|
---|
93 | #define O_RDONLY 0
|
---|
94 | #endif
|
---|
95 | #ifndef O_WRONLY
|
---|
96 | #define O_WRONLY 1
|
---|
97 | #endif
|
---|
98 | #ifndef O_RDWR
|
---|
99 | #define O_RDWR 2
|
---|
100 | #endif
|
---|
101 | #ifndef O_ACCMODE
|
---|
102 | #define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
|
---|
103 | #endif
|
---|
104 |
|
---|
105 | #ifndef SEEK_SET
|
---|
106 | #define SEEK_SET 0
|
---|
107 | #endif
|
---|
108 | #ifndef SEEK_CUR
|
---|
109 | #define SEEK_CUR 1
|
---|
110 | #endif
|
---|
111 |
|
---|
112 | #include "filenames.h"
|
---|
113 |
|
---|
114 | #ifdef NEED_DECLARATION_STRSTR
|
---|
115 | extern char *strstr ();
|
---|
116 | #endif
|
---|
117 |
|
---|
118 | #ifdef NEED_DECLARATION_MALLOC
|
---|
119 | extern PTR malloc ();
|
---|
120 | #endif
|
---|
121 |
|
---|
122 | #ifdef NEED_DECLARATION_REALLOC
|
---|
123 | extern PTR realloc ();
|
---|
124 | #endif
|
---|
125 |
|
---|
126 | #ifdef NEED_DECLARATION_FREE
|
---|
127 | extern void free ();
|
---|
128 | #endif
|
---|
129 |
|
---|
130 | #ifdef NEED_DECLARATION_GETENV
|
---|
131 | extern char *getenv ();
|
---|
132 | #endif
|
---|
133 |
|
---|
134 | /* Define offsetof for those systems which lack it */
|
---|
135 |
|
---|
136 | #ifndef offsetof
|
---|
137 | #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
|
---|
138 | #endif
|
---|
139 |
|
---|
140 | #ifdef ENABLE_NLS
|
---|
141 | #include <libintl.h>
|
---|
142 | /* Note the use of dgetext() and PACKAGE here, rather than gettext().
|
---|
143 |
|
---|
144 | This is because the code in this directory is used to build a library which
|
---|
145 | will be linked with code in other directories to form programs. We want to
|
---|
146 | maintain a seperate translation file for this directory however, rather
|
---|
147 | than being forced to merge it with that of any program linked to libbfd.
|
---|
148 | This is a library, so it cannot depend on the catalog currently loaded.
|
---|
149 |
|
---|
150 | In order to do this, we have to make sure that when we extract messages we
|
---|
151 | use the OPCODES domain rather than the domain of the program that included
|
---|
152 | the bfd library, (eg OBJDUMP). Hence we use dgettext (PACKAGE, String)
|
---|
153 | and define PACKAGE to be 'bfd'. (See the code in configure). */
|
---|
154 | #define _(String) dgettext (PACKAGE, String)
|
---|
155 | #ifdef gettext_noop
|
---|
156 | #define N_(String) gettext_noop (String)
|
---|
157 | #else
|
---|
158 | #define N_(String) (String)
|
---|
159 | #endif
|
---|
160 | #else
|
---|
161 | # define gettext(Msgid) (Msgid)
|
---|
162 | # define dgettext(Domainname, Msgid) (Msgid)
|
---|
163 | # define dcgettext(Domainname, Msgid, Category) (Msgid)
|
---|
164 | # define textdomain(Domainname) while (0) /* nothing */
|
---|
165 | # define bindtextdomain(Domainname, Dirname) while (0) /* nothing */
|
---|
166 | # define _(String) (String)
|
---|
167 | # define N_(String) (String)
|
---|
168 | #endif
|
---|
169 |
|
---|
170 | #endif /* ! defined (BFD_SYSDEP_H) */
|
---|