Subversion Repositories Kolibri OS

Rev

Rev 5812 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. /* sysdep.h -- handle host dependencies for binutils
  2.    Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
  3.    2001, 2002, 2003, 2005, 2006, 2007, 2008, 2009, 2012
  4.    Free Software Foundation, Inc.
  5.  
  6.    This file is part of GNU Binutils.
  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 3 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., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
  21. #ifndef _BIN_SYSDEP_H
  22. #define _BIN_SYSDEP_H
  23.  
  24. #include "alloca-conf.h"
  25. #include "ansidecl.h"
  26. #include <stdio.h>
  27. #include <sys/types.h>
  28.  
  29. #include "bfdver.h"
  30.  
  31. #include <stdarg.h>
  32.  
  33. #ifdef USE_BINARY_FOPEN
  34. #include "fopen-bin.h"
  35. #else
  36. #include "fopen-same.h"
  37. #endif
  38.  
  39. #include <errno.h>
  40. #ifndef errno
  41. extern int errno;
  42. #endif
  43.  
  44. #ifdef HAVE_UNISTD_H
  45. #include <unistd.h>
  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 HAVE_FCNTL_H
  69. #include <fcntl.h>
  70. #else
  71. #ifdef HAVE_SYS_FILE_H
  72. #include <sys/file.h>
  73. #endif
  74. #endif
  75.  
  76. #ifdef HAVE_SYS_STAT_H
  77. #include <sys/stat.h>
  78. #endif
  79.  
  80. #include "binary-io.h"
  81.  
  82. #if !HAVE_DECL_STPCPY
  83. extern char *stpcpy (char *, const char *);
  84. #endif
  85.  
  86. #if !HAVE_DECL_STRSTR
  87. extern char *strstr ();
  88. #endif
  89.  
  90. #ifdef HAVE_SBRK
  91. #if !HAVE_DECL_SBRK
  92. extern char *sbrk ();
  93. #endif
  94. #endif
  95.  
  96. #if !HAVE_DECL_GETENV
  97. extern char *getenv ();
  98. #endif
  99.  
  100. #if !HAVE_DECL_ENVIRON
  101. extern char **environ;
  102. #endif
  103.  
  104. #if !HAVE_DECL_FPRINTF
  105. extern int fprintf (FILE *, const char *, ...);
  106. #endif
  107.  
  108. #if !HAVE_DECL_SNPRINTF
  109. extern int snprintf(char *, size_t, const char *, ...);
  110. #endif
  111.  
  112. #if !HAVE_DECL_VSNPRINTF
  113. extern int vsnprintf(char *, size_t, const char *, va_list);
  114. #endif
  115.  
  116. #ifndef O_RDONLY
  117. #define O_RDONLY 0
  118. #endif
  119.  
  120. #ifndef O_RDWR
  121. #define O_RDWR 2
  122. #endif
  123.  
  124. #ifndef SEEK_SET
  125. #define SEEK_SET 0
  126. #endif
  127. #ifndef SEEK_CUR
  128. #define SEEK_CUR 1
  129. #endif
  130. #ifndef SEEK_END
  131. #define SEEK_END 2
  132. #endif
  133.  
  134. #ifdef HAVE_LOCALE_H
  135. # ifndef ENABLE_NLS
  136.    /* The Solaris version of locale.h always includes libintl.h.  If we have
  137.       been configured with --disable-nls then ENABLE_NLS will not be defined
  138.       and the dummy definitions of bindtextdomain (et al) below will conflict
  139.       with the defintions in libintl.h.  So we define these values to prevent
  140.       the bogus inclusion of libintl.h.  */
  141. #  define _LIBINTL_H
  142. #  define _LIBGETTEXT_H
  143. # endif
  144. # include <locale.h>
  145. #endif
  146.  
  147. #ifdef ENABLE_NLS
  148. # include <libintl.h>
  149. # define _(String) gettext (String)
  150. # ifdef gettext_noop
  151. #  define N_(String) gettext_noop (String)
  152. # else
  153. #  define N_(String) (String)
  154. # endif
  155. #else
  156. # define gettext(Msgid) (Msgid)
  157. # define dgettext(Domainname, Msgid) (Msgid)
  158. # define dcgettext(Domainname, Msgid, Category) (Msgid)
  159. # define textdomain(Domainname) while (0) /* nothing */
  160. # define bindtextdomain(Domainname, Dirname) while (0) /* nothing */
  161. # define _(String) (String)
  162. # define N_(String) (String)
  163. #endif
  164.  
  165. /* Used by ar.c and objcopy.c.  */
  166. #define BUFSIZE 8192
  167.  
  168. /* For PATH_MAX.  */
  169. #ifdef HAVE_LIMITS_H
  170. #include <limits.h>
  171. #endif
  172.  
  173. #ifndef PATH_MAX
  174. /* For MAXPATHLEN.  */
  175. # ifdef HAVE_SYS_PARAM_H
  176. #  include <sys/param.h>
  177. # endif
  178. # ifndef PATH_MAX
  179. #  ifdef MAXPATHLEN
  180. #   define PATH_MAX MAXPATHLEN
  181. #  else
  182. #   define PATH_MAX 1024
  183. #  endif
  184. # endif
  185. #endif
  186.  
  187. #endif /* _BIN_SYSDEP_H */
  188.