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