Subversion Repositories Kolibri OS

Rev

Rev 5199 | Blame | Compare with Previous | Last modification | View Log | RSS feed

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