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 TRAD_HEADER
|
---|
30 | #include TRAD_HEADER
|
---|
31 | #endif
|
---|
32 |
|
---|
33 | #ifdef HAVE_STDDEF_H
|
---|
34 | #include <stddef.h>
|
---|
35 | #endif
|
---|
36 |
|
---|
37 | #include <stdio.h>
|
---|
38 | #include <sys/types.h>
|
---|
39 | #include <sys/stat.h>
|
---|
40 |
|
---|
41 | #include <errno.h>
|
---|
42 | #if !(defined(errno) || defined(_MSC_VER) && defined(_INC_ERRNO))
|
---|
43 | extern int errno;
|
---|
44 | #endif
|
---|
45 |
|
---|
46 | #ifdef HAVE_STRING_H
|
---|
47 | #include <string.h>
|
---|
48 | #else
|
---|
49 | #ifdef HAVE_STRINGS_H
|
---|
50 | #include <strings.h>
|
---|
51 | #else
|
---|
52 | extern char *strchr ();
|
---|
53 | extern char *strrchr ();
|
---|
54 | #endif
|
---|
55 | #endif
|
---|
56 |
|
---|
57 | #ifdef HAVE_STDLIB_H
|
---|
58 | #include <stdlib.h>
|
---|
59 | #endif
|
---|
60 |
|
---|
61 | #ifdef TIME_WITH_SYS_TIME
|
---|
62 | #include <sys/time.h>
|
---|
63 | #include <time.h>
|
---|
64 | #else
|
---|
65 | #ifdef HAVE_SYS_TIME_H
|
---|
66 | #include <sys/time.h>
|
---|
67 | #else
|
---|
68 | #include <time.h>
|
---|
69 | #endif
|
---|
70 | #endif
|
---|
71 |
|
---|
72 | #ifdef HAVE_UNISTD_H
|
---|
73 | #include <unistd.h>
|
---|
74 | #endif
|
---|
75 |
|
---|
76 | #ifdef USE_BINARY_FOPEN
|
---|
77 | #include "fopen-bin.h"
|
---|
78 | #else
|
---|
79 | #include "fopen-same.h"
|
---|
80 | #endif
|
---|
81 |
|
---|
82 | #ifdef HAVE_FCNTL_H
|
---|
83 | #include <fcntl.h>
|
---|
84 | #else
|
---|
85 | #ifdef HAVE_SYS_FILE_H
|
---|
86 | #include <sys/file.h>
|
---|
87 | #endif
|
---|
88 | #endif
|
---|
89 |
|
---|
90 | #ifndef O_RDONLY
|
---|
91 | #define O_RDONLY 0
|
---|
92 | #endif
|
---|
93 | #ifndef O_WRONLY
|
---|
94 | #define O_WRONLY 1
|
---|
95 | #endif
|
---|
96 | #ifndef O_RDWR
|
---|
97 | #define O_RDWR 2
|
---|
98 | #endif
|
---|
99 | #ifndef O_ACCMODE
|
---|
100 | #define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
|
---|
101 | #endif
|
---|
102 |
|
---|
103 | #ifndef SEEK_SET
|
---|
104 | #define SEEK_SET 0
|
---|
105 | #endif
|
---|
106 | #ifndef SEEK_CUR
|
---|
107 | #define SEEK_CUR 1
|
---|
108 | #endif
|
---|
109 |
|
---|
110 | #include "filenames.h"
|
---|
111 |
|
---|
112 | #ifdef NEED_DECLARATION_STRSTR
|
---|
113 | extern char *strstr ();
|
---|
114 | #endif
|
---|
115 |
|
---|
116 | #ifdef NEED_DECLARATION_MALLOC
|
---|
117 | extern PTR malloc ();
|
---|
118 | #endif
|
---|
119 |
|
---|
120 | #ifdef NEED_DECLARATION_REALLOC
|
---|
121 | extern PTR realloc ();
|
---|
122 | #endif
|
---|
123 |
|
---|
124 | #ifdef NEED_DECLARATION_FREE
|
---|
125 | extern void free ();
|
---|
126 | #endif
|
---|
127 |
|
---|
128 | #ifdef NEED_DECLARATION_GETENV
|
---|
129 | extern char *getenv ();
|
---|
130 | #endif
|
---|
131 |
|
---|
132 | #ifdef ENABLE_NLS
|
---|
133 | #include <libintl.h>
|
---|
134 | /* Note the use of dgetext() and PACKAGE here, rather than gettext().
|
---|
135 |
|
---|
136 | This is because the code in this directory is used to build a library which
|
---|
137 | will be linked with code in other directories to form programs. We want to
|
---|
138 | maintain a seperate translation file for this directory however, rather
|
---|
139 | than being forced to merge it with that of any program linked to libbfd.
|
---|
140 | This is a library, so it cannot depend on the catalog currently loaded.
|
---|
141 |
|
---|
142 | In order to do this, we have to make sure that when we extract messages we
|
---|
143 | use the OPCODES domain rather than the domain of the program that included
|
---|
144 | the bfd library, (eg OBJDUMP). Hence we use dgettext (PACKAGE, String)
|
---|
145 | and define PACKAGE to be 'bfd'. (See the code in configure). */
|
---|
146 | #define _(String) dgettext (PACKAGE, String)
|
---|
147 | #ifdef gettext_noop
|
---|
148 | #define N_(String) gettext_noop (String)
|
---|
149 | #else
|
---|
150 | #define N_(String) (String)
|
---|
151 | #endif
|
---|
152 | #else
|
---|
153 | # define gettext(Msgid) (Msgid)
|
---|
154 | # define dgettext(Domainname, Msgid) (Msgid)
|
---|
155 | # define dcgettext(Domainname, Msgid, Category) (Msgid)
|
---|
156 | # define textdomain(Domainname) while (0) /* nothing */
|
---|
157 | # define bindtextdomain(Domainname, Dirname) while (0) /* nothing */
|
---|
158 | # define _(String) (String)
|
---|
159 | # define N_(String) (String)
|
---|
160 | #endif
|
---|
161 |
|
---|
162 | #endif /* ! defined (BFD_SYSDEP_H) */
|
---|