00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef BFD_SYSDEP_H
00023 #define BFD_SYSDEP_H
00024
00025 #include "ansidecl.h"
00026
00027 #include "config.h"
00028
00029 #ifdef HAVE_STDDEF_H
00030 #include <stddef.h>
00031 #endif
00032
00033 #include <stdio.h>
00034 #include <sys/types.h>
00035 #include <sys/stat.h>
00036
00037 #include <errno.h>
00038 #if !(defined(errno) || defined(_MSC_VER) && defined(_INC_ERRNO))
00039 extern int errno;
00040 #endif
00041
00042 #ifdef HAVE_STRING_H
00043 #include <string.h>
00044 #else
00045 #ifdef HAVE_STRINGS_H
00046 #include <strings.h>
00047 #else
00048 extern char *strchr ();
00049 extern char *strrchr ();
00050 #endif
00051 #endif
00052
00053 #ifdef HAVE_STDLIB_H
00054 #include <stdlib.h>
00055 #endif
00056
00057 #ifdef TIME_WITH_SYS_TIME
00058 #include <sys/time.h>
00059 #include <time.h>
00060 #else
00061 #ifdef HAVE_SYS_TIME_H
00062 #include <sys/time.h>
00063 #else
00064 #include <time.h>
00065 #endif
00066 #endif
00067
00068 #ifdef HAVE_UNISTD_H
00069 #include <unistd.h>
00070 #endif
00071
00072 #ifdef USE_BINARY_FOPEN
00073 #include "fopen-bin.h"
00074 #else
00075 #include "fopen-same.h"
00076 #endif
00077
00078 #ifdef HAVE_FCNTL_H
00079 #include <fcntl.h>
00080 #else
00081 #ifdef HAVE_SYS_FILE_H
00082 #include <sys/file.h>
00083 #endif
00084 #endif
00085
00086 #ifndef O_RDONLY
00087 #define O_RDONLY 0
00088 #endif
00089 #ifndef O_WRONLY
00090 #define O_WRONLY 1
00091 #endif
00092 #ifndef O_RDWR
00093 #define O_RDWR 2
00094 #endif
00095 #ifndef O_ACCMODE
00096 #define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
00097 #endif
00098
00099 #ifndef SEEK_SET
00100 #define SEEK_SET 0
00101 #endif
00102 #ifndef SEEK_CUR
00103 #define SEEK_CUR 1
00104 #endif
00105
00106 #include "filenames.h"
00107
00108 #ifdef NEED_DECLARATION_STRSTR
00109 extern char *strstr ();
00110 #endif
00111
00112 #ifdef NEED_DECLARATION_MALLOC
00113 extern PTR malloc ();
00114 #endif
00115
00116 #ifdef NEED_DECLARATION_REALLOC
00117 extern PTR realloc ();
00118 #endif
00119
00120 #ifdef NEED_DECLARATION_FREE
00121 extern void free ();
00122 #endif
00123
00124 #ifdef NEED_DECLARATION_GETENV
00125 extern char *getenv ();
00126 #endif
00127
00128
00129
00130 #ifndef offsetof
00131 #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
00132 #endif
00133
00134 #ifdef ENABLE_NLS
00135 #include <libintl.h>
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148 #define _(String) dgettext (PACKAGE, String)
00149 #ifdef gettext_noop
00150 #define N_(String) gettext_noop (String)
00151 #else
00152 #define N_(String) (String)
00153 #endif
00154 #else
00155 # define gettext(Msgid) (Msgid)
00156 # define dgettext(Domainname, Msgid) (Msgid)
00157 # define dcgettext(Domainname, Msgid, Category) (Msgid)
00158 # define textdomain(Domainname) while (0)
00159 # define bindtextdomain(Domainname, Dirname) while (0)
00160 # define _(String) (String)
00161 # define N_(String) (String)
00162 #endif
00163
00164 #endif