Subversion Repositories Kolibri OS

Rev

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

  1. /* sysdep.h -- handle host dependencies for binutils
  2.    Copyright (C) 1991-2015 Free Software Foundation, Inc.
  3.  
  4.    This file is part of GNU Binutils.
  5.  
  6.    This program is free software; you can redistribute it and/or modify
  7.    it under the terms of the GNU General Public License as published by
  8.    the Free Software Foundation; either version 3 of the License, or
  9.    (at your option) any later version.
  10.  
  11.    This program is distributed in the hope that it will be useful,
  12.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.    GNU General Public License for more details.
  15.  
  16.    You should have received a copy of the GNU General Public License
  17.    along with this program; if not, write to the Free Software
  18.    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
  19. #ifndef _BIN_SYSDEP_H
  20. #define _BIN_SYSDEP_H
  21.  
  22. #include "alloca-conf.h"
  23. #include "ansidecl.h"
  24. #include <stdio.h>
  25. #include <sys/types.h>
  26.  
  27. #include "bfdver.h"
  28.  
  29. #include <stdarg.h>
  30.  
  31. #ifdef USE_BINARY_FOPEN
  32. #include "fopen-bin.h"
  33. #else
  34. #include "fopen-same.h"
  35. #endif
  36.  
  37. #include <errno.h>
  38. #ifndef errno
  39. extern int errno;
  40. #endif
  41.  
  42. #ifdef HAVE_UNISTD_H
  43. #include <unistd.h>
  44. #endif
  45.  
  46. #ifdef STRING_WITH_STRINGS
  47. #include <string.h>
  48. #include <strings.h>
  49. #else
  50. #ifdef HAVE_STRING_H
  51. #include <string.h>
  52. #else
  53. #ifdef HAVE_STRINGS_H
  54. #include <strings.h>
  55. #else
  56. extern char *strchr ();
  57. extern char *strrchr ();
  58. #endif
  59. #endif
  60. #endif
  61.  
  62. #ifdef HAVE_STDLIB_H
  63. #include <stdlib.h>
  64. #endif
  65.  
  66. #ifdef HAVE_FCNTL_H
  67. #include <fcntl.h>
  68. #else
  69. #ifdef HAVE_SYS_FILE_H
  70. #include <sys/file.h>
  71. #endif
  72. #endif
  73.  
  74. #ifdef HAVE_SYS_STAT_H
  75. #include <sys/stat.h>
  76. #endif
  77.  
  78. #include "binary-io.h"
  79.  
  80. #if !HAVE_DECL_STPCPY
  81. extern char *stpcpy (char *, const char *);
  82. #endif
  83.  
  84. #if !HAVE_DECL_STRSTR
  85. extern char *strstr ();
  86. #endif
  87.  
  88. #ifdef HAVE_SBRK
  89. #if !HAVE_DECL_SBRK
  90. extern char *sbrk ();
  91. #endif
  92. #endif
  93.  
  94. #if !HAVE_DECL_GETENV
  95. extern char *getenv ();
  96. #endif
  97.  
  98. #if !HAVE_DECL_ENVIRON
  99. extern char **environ;
  100. #endif
  101.  
  102. #if !HAVE_DECL_FPRINTF
  103. extern int fprintf (FILE *, const char *, ...);
  104. #endif
  105.  
  106. #if !HAVE_DECL_SNPRINTF
  107. extern int snprintf(char *, size_t, const char *, ...);
  108. #endif
  109.  
  110. #if !HAVE_DECL_VSNPRINTF
  111. extern int vsnprintf(char *, size_t, const char *, va_list);
  112. #endif
  113.  
  114. #if !HAVE_DECL_STRNLEN
  115. size_t strnlen (const char *, size_t);
  116. #endif
  117.  
  118. #ifndef O_RDONLY
  119. #define O_RDONLY 0
  120. #endif
  121.  
  122. #ifndef O_RDWR
  123. #define O_RDWR 2
  124. #endif
  125.  
  126. #ifndef SEEK_SET
  127. #define SEEK_SET 0
  128. #endif
  129. #ifndef SEEK_CUR
  130. #define SEEK_CUR 1
  131. #endif
  132. #ifndef SEEK_END
  133. #define SEEK_END 2
  134. #endif
  135.  
  136. #ifdef HAVE_LOCALE_H
  137. # ifndef ENABLE_NLS
  138.    /* The Solaris version of locale.h always includes libintl.h.  If we have
  139.       been configured with --disable-nls then ENABLE_NLS will not be defined
  140.       and the dummy definitions of bindtextdomain (et al) below will conflict
  141.       with the defintions in libintl.h.  So we define these values to prevent
  142.       the bogus inclusion of libintl.h.  */
  143. #  define _LIBINTL_H
  144. #  define _LIBGETTEXT_H
  145. # endif
  146. # include <locale.h>
  147. #endif
  148.  
  149. #ifdef ENABLE_NLS
  150. # include <libintl.h>
  151. # define _(String) gettext (String)
  152. # ifdef gettext_noop
  153. #  define N_(String) gettext_noop (String)
  154. # else
  155. #  define N_(String) (String)
  156. # endif
  157. #else
  158. # define gettext(Msgid) (Msgid)
  159. # define dgettext(Domainname, Msgid) (Msgid)
  160. # define dcgettext(Domainname, Msgid, Category) (Msgid)
  161. # define textdomain(Domainname) while (0) /* nothing */
  162. # define bindtextdomain(Domainname, Dirname) while (0) /* nothing */
  163. # define _(String) (String)
  164. # define N_(String) (String)
  165. #endif
  166.  
  167. /* Used by ar.c and objcopy.c.  */
  168. #define BUFSIZE 8192
  169.  
  170. /* For PATH_MAX.  */
  171. #ifdef HAVE_LIMITS_H
  172. #include <limits.h>
  173. #endif
  174.  
  175. #ifndef PATH_MAX
  176. /* For MAXPATHLEN.  */
  177. # ifdef HAVE_SYS_PARAM_H
  178. #  include <sys/param.h>
  179. # endif
  180. # ifndef PATH_MAX
  181. #  ifdef MAXPATHLEN
  182. #   define PATH_MAX MAXPATHLEN
  183. #  else
  184. #   define PATH_MAX 1024
  185. #  endif
  186. # endif
  187. #endif
  188.  
  189. #endif /* _BIN_SYSDEP_H */
  190.