OSDN Git Service

* sh.h (CPP_SPEC): Add -D__NOMACSAVE__ for -mnomacsave.
[pf3gnuchains/gcc-fork.git] / gcc / system.h
1 /* Get common system includes and various definitions and declarations based
2    on autoconf macros.
3    Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
4
5 This file is part of GNU CC.
6
7 GNU CC 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 2, or (at your option)
10 any later version.
11
12 GNU CC 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 GNU CC; see the file COPYING.  If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA.  */
21
22
23 #ifndef __GCC_SYSTEM_H__
24 #define __GCC_SYSTEM_H__
25
26 /* This is the location of the online document giving information how
27    to report bugs. If you change this string, also check for strings
28    not under control of the preprocessor.  */
29 #define GCCBUGURL "<URL:http://www.gnu.org/software/gcc/bugs.html>"
30
31 /* We must include stdarg.h/varargs.h before stdio.h. */
32 #ifdef ANSI_PROTOTYPES
33 #include <stdarg.h>
34 #else
35 #include <varargs.h>
36 #endif
37
38 #ifndef va_copy
39 # ifdef __va_copy
40 #   define va_copy(d,s)  __va_copy((d),(s))
41 # else
42 #   define va_copy(d,s)  ((d) = (s))
43 # endif
44 #endif
45
46 #include <stdio.h>
47
48 /* Define a generic NULL if one hasn't already been defined.  */
49 #ifndef NULL
50 #define NULL 0
51 #endif
52
53 /* The compiler is not a multi-threaded application and therefore we
54    do not have to use the locking functions.
55
56    HAVE_DECL_PUTC_UNLOCKED actually indicates whether or not the IO
57    code is multi-thread safe by default.  If it is set to 0, then do
58    not worry about using the _unlocked functions.
59    
60    fputs_unlocked is an extension and needs to be prototyped specially.  */
61
62 #if defined HAVE_PUTC_UNLOCKED && (defined (HAVE_DECL_PUTC_UNLOCKED) && HAVE_DECL_PUTC_UNLOCKED)
63 # undef putc
64 # define putc(C, Stream) putc_unlocked (C, Stream)
65 #endif
66 #if defined HAVE_FPUTC_UNLOCKED && (defined (HAVE_DECL_PUTC_UNLOCKED) && HAVE_DECL_PUTC_UNLOCKED)
67 # undef fputc
68 # define fputc(C, Stream) fputc_unlocked (C, Stream)
69 #endif
70 #if defined HAVE_FPUTS_UNLOCKED && (defined (HAVE_DECL_PUTC_UNLOCKED) && HAVE_DECL_PUTC_UNLOCKED)
71 # undef fputs
72 # define fputs(String, Stream) fputs_unlocked (String, Stream)
73 # if defined (HAVE_DECL_FPUTS_UNLOCKED) && !HAVE_DECL_FPUTS_UNLOCKED
74 extern int fputs_unlocked PARAMS ((const char *, FILE *));
75 # endif
76 #endif
77
78 #include <ctype.h>
79
80 /* Jim Meyering writes:
81
82    "... Some ctype macros are valid only for character codes that
83    isascii says are ASCII (SGI's IRIX-4.0.5 is one such system --when
84    using /bin/cc or gcc but without giving an ansi option).  So, all
85    ctype uses should be through macros like ISPRINT...  If
86    STDC_HEADERS is defined, then autoconf has verified that the ctype
87    macros don't need to be guarded with references to isascii. ...
88    Defining isascii to 1 should let any compiler worth its salt
89    eliminate the && through constant folding."
90
91    Bruno Haible adds:
92
93    "... Furthermore, isupper(c) etc. have an undefined result if c is
94    outside the range -1 <= c <= 255. One is tempted to write isupper(c)
95    with c being of type `char', but this is wrong if c is an 8-bit
96    character >= 128 which gets sign-extended to a negative value.
97    The macro ISUPPER protects against this as well."  */
98
99 #if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII)) || defined(HOST_EBCDIC)
100 # define IN_CTYPE_DOMAIN(c) 1
101 #else
102 # define IN_CTYPE_DOMAIN(c) isascii(c)
103 #endif
104
105 /* The ctype functions are often implemented as macros which do
106    lookups in arrays using the parameter as the offset.  If the ctype
107    function parameter is a char, then gcc will (appropriately) warn
108    that a "subscript has type char".  Using a (signed) char as a subscript
109    is bad because you may get negative offsets and thus it is not 8-bit
110    safe.  The CTYPE_CONV macro ensures that the parameter is cast to an
111    unsigned char when a char is passed in.  When an int is passed in, the
112    parameter is left alone so we don't lose EOF.
113 */
114
115 #define CTYPE_CONV(CH) \
116   (sizeof(CH) == sizeof(unsigned char) ? (int)(unsigned char)(CH) : (int)(CH))
117
118
119 /* WARNING!  The argument to the ctype replacement macros below is
120    evaluated more than once so it must not have side effects!  */
121
122 #ifdef isblank
123 # define ISBLANK(c) (IN_CTYPE_DOMAIN (c) && isblank (CTYPE_CONV(c)))
124 #else
125 # define ISBLANK(c) ((c) == ' ' || (c) == '\t')
126 #endif
127 #ifdef isgraph
128 # define ISGRAPH(c) (IN_CTYPE_DOMAIN (c) && isgraph (CTYPE_CONV(c)))
129 #else
130 # define ISGRAPH(c) (IN_CTYPE_DOMAIN (c) && isprint (CTYPE_CONV(c)) && !isspace (CTYPE_CONV(c)))
131 #endif
132
133 #define ISPRINT(c) (IN_CTYPE_DOMAIN (c) && isprint (CTYPE_CONV(c)))
134 #define ISALNUM(c) (IN_CTYPE_DOMAIN (c) && isalnum (CTYPE_CONV(c)))
135 #define ISALPHA(c) (IN_CTYPE_DOMAIN (c) && isalpha (CTYPE_CONV(c)))
136 #define ISCNTRL(c) (IN_CTYPE_DOMAIN (c) && iscntrl (CTYPE_CONV(c)))
137 #define ISLOWER(c) (IN_CTYPE_DOMAIN (c) && islower (CTYPE_CONV(c)))
138 #define ISPUNCT(c) (IN_CTYPE_DOMAIN (c) && ispunct (CTYPE_CONV(c)))
139 #define ISSPACE(c) (IN_CTYPE_DOMAIN (c) && isspace (CTYPE_CONV(c)))
140 #define ISUPPER(c) (IN_CTYPE_DOMAIN (c) && isupper (CTYPE_CONV(c)))
141 #define ISXDIGIT(c) (IN_CTYPE_DOMAIN (c) && isxdigit (CTYPE_CONV(c)))
142 #define ISDIGIT_LOCALE(c) (IN_CTYPE_DOMAIN (c) && isdigit (CTYPE_CONV(c)))
143
144 #if STDC_HEADERS
145 # define TOLOWER(c) (tolower (CTYPE_CONV(c)))
146 # define TOUPPER(c) (toupper (CTYPE_CONV(c)))
147 #else
148 # define TOLOWER(c) (ISUPPER (c) ? tolower (CTYPE_CONV(c)) : (c))
149 # define TOUPPER(c) (ISLOWER (c) ? toupper (CTYPE_CONV(c)) : (c))
150 #endif
151
152 /* ISDIGIT differs from ISDIGIT_LOCALE, as follows:
153    - Its arg may be any int or unsigned int; it need not be an unsigned char.
154    - It's guaranteed to evaluate its argument exactly once.
155    - It's typically faster.
156    Posix 1003.2-1992 section 2.5.2.1 page 50 lines 1556-1558 says that
157    only '0' through '9' are digits.  Prefer ISDIGIT to ISDIGIT_LOCALE unless
158    it's important to use the locale's definition of `digit' even when the
159    host does not conform to Posix.  */
160 #define ISDIGIT(c) ((unsigned) (c) - '0' <= 9)
161
162 /* Define a default escape character; its different for EBCDIC.  */
163 #ifndef TARGET_ESC
164 #define TARGET_ESC 033
165 #endif
166
167 #include <sys/types.h>
168
169 #include <errno.h>
170
171 #ifndef errno
172 extern int errno;
173 #endif
174
175 #ifdef STRING_WITH_STRINGS
176 # include <string.h>
177 # include <strings.h>
178 #else
179 # ifdef HAVE_STRING_H
180 #  include <string.h>
181 # else
182 #  ifdef HAVE_STRINGS_H
183 #   include <strings.h>
184 #  endif
185 # endif
186 #endif
187
188 #ifdef HAVE_STDLIB_H
189 # include <stdlib.h>
190 # ifdef USE_C_ALLOCA
191 /* Note that systems that use glibc have a <stdlib.h> that includes
192    <alloca.h> that defines alloca, so let USE_C_ALLOCA override this. */
193 # undef alloca
194 #endif
195 #endif
196
197 #ifdef HAVE_UNISTD_H
198 # include <unistd.h>
199 #endif
200
201 #ifdef HAVE_SYS_PARAM_H
202 # include <sys/param.h>
203 #endif
204
205 #if HAVE_LIMITS_H
206 # include <limits.h>
207 #endif
208
209 /* Find HOST_WIDEST_INT and set its bit size, type and print macros.
210    It will be the largest integer mode supported by the host which may
211    (or may not) be larger than HOST_WIDE_INT.  This must appear after
212    <limits.h> since we only use `long long' if its bigger than a
213    `long' and also if it is supported by macros in limits.h.  For old
214    hosts which don't have a limits.h (and thus won't include it in
215    stage2 cause we don't rerun configure) we assume gcc supports long
216    long.)  Note, you won't get these defined if you don't include
217    {ht}config.h before this file to set the HOST_BITS_PER_* macros. */
218
219 #ifndef HOST_WIDEST_INT
220 # if defined (HOST_BITS_PER_LONG) && defined (HOST_BITS_PER_LONGLONG)
221 #  if (HOST_BITS_PER_LONGLONG > HOST_BITS_PER_LONG) && (defined (LONG_LONG_MAX) || defined (LONGLONG_MAX) || defined (LLONG_MAX) || defined (__GNUC__))
222 #   define HOST_BITS_PER_WIDEST_INT HOST_BITS_PER_LONGLONG
223 #   define HOST_WIDEST_INT long long
224 #   define HOST_WIDEST_INT_PRINT_DEC "%lld"
225 #   define HOST_WIDEST_INT_PRINT_UNSIGNED "%llu"
226 #   define HOST_WIDEST_INT_PRINT_HEX "0x%llx"
227 #  else
228 #   define HOST_BITS_PER_WIDEST_INT HOST_BITS_PER_LONG
229 #   define HOST_WIDEST_INT long
230 #   define HOST_WIDEST_INT_PRINT_DEC "%ld"
231 #   define HOST_WIDEST_INT_PRINT_UNSIGNED "%lu"
232 #   define HOST_WIDEST_INT_PRINT_HEX "0x%lx"
233 #  endif /*(long long>long) && (LONG_LONG_MAX||LONGLONG_MAX||LLONG_MAX||GNUC)*/
234 # endif /* defined(HOST_BITS_PER_LONG) && defined(HOST_BITS_PER_LONGLONG) */
235 #endif /* ! HOST_WIDEST_INT */
236
237 /* Infrastructure for defining missing _MAX and _MIN macros.  Note that
238    macros defined with these cannot be used in #if.  */
239
240 /* The extra casts work around common compiler bugs.  */
241 #define INTTYPE_SIGNED(t) (! ((t) 0 < (t) -1))
242 /* The outer cast is needed to work around a bug in Cray C 5.0.3.0.
243    It is necessary at least when t == time_t.  */
244 #define INTTYPE_MINIMUM(t) ((t) (INTTYPE_SIGNED (t) \
245                              ? ~ (t) 0 << (sizeof(t) * CHAR_BIT - 1) : (t) 0))
246 #define INTTYPE_MAXIMUM(t) ((t) (~ (t) 0 - INTTYPE_MINIMUM (t)))
247
248 /* Use that infrastructure to provide a few constants.  */
249 #ifndef UCHAR_MAX
250 # define UCHAR_MAX INTTYPE_MAXIMUM (unsigned char)
251 #endif
252
253 #ifndef SSIZE_MAX
254 # define SSIZE_MAX INTTYPE_MAXIMUM (ssize_t)
255 #endif
256
257 #ifdef TIME_WITH_SYS_TIME
258 # include <sys/time.h>
259 # include <time.h>
260 #else
261 # if HAVE_SYS_TIME_H
262 #  include <sys/time.h>
263 # else
264 #  ifdef HAVE_TIME_H
265 #   include <time.h>
266 #  endif
267 # endif
268 #endif
269
270 #ifdef HAVE_FCNTL_H
271 # include <fcntl.h>
272 #else
273 # ifdef HAVE_SYS_FILE_H
274 #  include <sys/file.h>
275 # endif
276 #endif
277
278 #ifndef SEEK_SET
279 # define SEEK_SET 0
280 # define SEEK_CUR 1
281 # define SEEK_END 2
282 #endif
283 #ifndef F_OK
284 # define F_OK 0
285 # define X_OK 1
286 # define W_OK 2
287 # define R_OK 4
288 #endif
289 #ifndef O_RDONLY
290 # define O_RDONLY 0
291 #endif
292 #ifndef O_WRONLY
293 # define O_WRONLY 1
294 #endif
295
296 /* Some systems define these in, e.g., param.h.  We undefine these names
297    here to avoid the warnings.  We prefer to use our definitions since we
298    know they are correct.  */
299
300 #undef MIN
301 #undef MAX
302 #define MIN(X,Y) ((X) < (Y) ? (X) : (Y))
303 #define MAX(X,Y) ((X) > (Y) ? (X) : (Y))
304
305 /* Returns the least number N such that N * Y >= X.  */
306 #define CEIL(x,y) (((x) + (y) - 1) / (y))
307
308 #ifdef HAVE_SYS_WAIT_H
309 #include <sys/wait.h>
310 #endif
311
312 #ifndef WIFSIGNALED
313 #define WIFSIGNALED(S) (((S) & 0xff) != 0 && ((S) & 0xff) != 0x7f)
314 #endif
315 #ifndef WTERMSIG
316 #define WTERMSIG(S) ((S) & 0x7f)
317 #endif
318 #ifndef WIFEXITED
319 #define WIFEXITED(S) (((S) & 0xff) == 0)
320 #endif
321 #ifndef WEXITSTATUS
322 #define WEXITSTATUS(S) (((S) & 0xff00) >> 8)
323 #endif
324 #ifndef WSTOPSIG
325 #define WSTOPSIG WEXITSTATUS
326 #endif
327
328 /* The HAVE_DECL_* macros are three-state, undefined, 0 or 1.  If they
329    are defined to 0 then we must provide the relevant declaration
330    here.  These checks will be in the undefined state while configure
331    is running so be careful to test "defined (HAVE_DECL_*)".  */
332
333 #ifndef bcopy
334 # ifdef HAVE_BCOPY
335 #  if defined (HAVE_DECL_BCOPY) && !HAVE_DECL_BCOPY
336 extern void bcopy PARAMS ((const PTR, PTR, size_t));
337 #  endif
338 # else /* ! HAVE_BCOPY */
339 #  define bcopy(src,dst,len) memmove((dst),(src),(len))
340 # endif
341 #endif
342
343 #ifndef bcmp
344 # ifdef HAVE_BCMP
345 #  if defined (HAVE_DECL_BCMP) && !HAVE_DECL_BCMP
346 extern int bcmp PARAMS ((const PTR, const PTR, size_t));
347 #  endif
348 # else /* ! HAVE_BCMP */
349 #  define bcmp(left,right,len) memcmp ((left),(right),(len))
350 # endif
351 #endif
352
353 #ifndef bzero
354 # ifdef HAVE_BZERO
355 #  if defined (HAVE_DECL_BZERO) && !HAVE_DECL_BZERO
356 extern void bzero PARAMS ((PTR, size_t));
357 #  endif
358 # else /* ! HAVE_BZERO */
359 #  define bzero(dst,len) memset ((dst),0,(len))
360 # endif
361 #endif
362
363 #ifndef index
364 # ifdef HAVE_INDEX
365 #  if defined (HAVE_DECL_INDEX) && !HAVE_DECL_INDEX
366 extern char *index PARAMS ((const char *, int));
367 #  endif
368 # else /* ! HAVE_INDEX */
369 #  define index strchr
370 # endif
371 #endif
372
373 #ifndef rindex
374 # ifdef HAVE_RINDEX
375 #  if defined (HAVE_DECL_RINDEX) && !HAVE_DECL_RINDEX
376 extern char *rindex PARAMS ((const char *, int));
377 #  endif
378 # else /* ! HAVE_RINDEX */
379 #  define rindex strrchr
380 # endif
381 #endif
382
383 #if defined (HAVE_DECL_ATOF) && !HAVE_DECL_ATOF
384 extern double atof PARAMS ((const char *));
385 #endif
386
387 #if defined (HAVE_DECL_ATOL) && !HAVE_DECL_ATOL
388 extern long atol PARAMS ((const char *));
389 #endif
390
391 #if defined (HAVE_DECL_FREE) && !HAVE_DECL_FREE
392 extern void free PARAMS ((PTR));
393 #endif
394
395 #if defined (HAVE_DECL_GETCWD) && !HAVE_DECL_GETCWD
396 extern char *getcwd PARAMS ((char *, size_t));
397 #endif
398
399 #if defined (HAVE_DECL_GETENV) && !HAVE_DECL_GETENV
400 extern char *getenv PARAMS ((const char *));
401 #endif
402
403 #if defined (HAVE_DECL_GETWD) && !HAVE_DECL_GETWD
404 extern char *getwd PARAMS ((char *));
405 #endif
406
407 #if defined (HAVE_DECL_SBRK) && !HAVE_DECL_SBRK
408 extern PTR sbrk PARAMS ((int));
409 #endif
410
411 #if defined (HAVE_DECL_STRSTR) && !HAVE_DECL_STRSTR
412 extern char *strstr PARAMS ((const char *, const char *));
413 #endif
414
415 #ifdef HAVE_MALLOC_H
416 #include <malloc.h>
417 #endif
418
419 #if defined (HAVE_DECL_MALLOC) && !HAVE_DECL_MALLOC
420 extern PTR malloc PARAMS ((size_t));
421 #endif
422
423 #if defined (HAVE_DECL_CALLOC) && !HAVE_DECL_CALLOC
424 extern PTR calloc PARAMS ((size_t, size_t));
425 #endif
426
427 #if defined (HAVE_DECL_REALLOC) && !HAVE_DECL_REALLOC
428 extern PTR realloc PARAMS ((PTR, size_t));
429 #endif
430
431 /* If the system doesn't provide strsignal, we get it defined in
432    libiberty but no declaration is supplied. */
433 #if defined (HAVE_DECL_STRSIGNAL) && !HAVE_DECL_STRSIGNAL
434 # ifndef strsignal
435 extern const char *strsignal PARAMS ((int));
436 # endif
437 #endif
438
439 #ifdef HAVE_GETRLIMIT
440 # if defined (HAVE_DECL_GETRLIMIT) && !HAVE_DECL_GETRLIMIT
441 #  ifndef getrlimit
442 #   ifdef ANSI_PROTOTYPES
443 struct rlimit;
444 #   endif
445 extern int getrlimit PARAMS ((int, struct rlimit *));
446 #  endif
447 # endif
448 #endif
449
450 #ifdef HAVE_SETRLIMIT
451 # if defined (HAVE_DECL_SETRLIMIT) && !HAVE_DECL_SETRLIMIT
452 #  ifndef setrlimit
453 #   ifdef ANSI_PROTOTYPES
454 struct rlimit;
455 #   endif
456 extern int setrlimit PARAMS ((int, const struct rlimit *));
457 #  endif
458 # endif
459 #endif
460
461 /* HAVE_VOLATILE only refers to the stage1 compiler.  We also check
462    __STDC__ and assume gcc sets it and has volatile in stage >=2. */
463 #if !defined(HAVE_VOLATILE) && !defined(__STDC__) && !defined(volatile)
464 #define volatile
465 #endif
466
467 #if defined (HAVE_DECL_ABORT) && !HAVE_DECL_ABORT
468 extern void abort PARAMS ((void));
469 #endif
470
471 /* Define a STRINGIFY macro that's right for ANSI or traditional C.
472    Note: if the argument passed to STRINGIFY is itself a macro, eg
473    #define foo bar, STRINGIFY(foo) will produce "foo", not "bar".
474    Although the __STDC__ case could be made to expand this via a layer
475    of indirection, the traditional C case can not do so.  Therefore
476    this behavior is not supported. */
477 #ifndef STRINGIFY
478 # ifdef HAVE_STRINGIZE
479 #  define STRINGIFY(STRING) #STRING
480 # else
481 #  define STRINGIFY(STRING) "STRING"
482 # endif
483 #endif /* ! STRINGIFY */
484
485 #if HAVE_SYS_STAT_H
486 # include <sys/stat.h>
487 #endif
488
489 /* Test if something is a normal file.  */
490 #ifndef S_ISREG
491 #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
492 #endif
493
494 /* Test if something is a directory.  */
495 #ifndef S_ISDIR
496 #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
497 #endif
498
499 /* Test if something is a character special file.  */
500 #ifndef S_ISCHR
501 #define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
502 #endif
503
504 /* Test if something is a block special file.  */
505 #ifndef S_ISBLK
506 #define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
507 #endif
508
509 /* Test if something is a socket.  */
510 #ifndef S_ISSOCK
511 # ifdef S_IFSOCK
512 #   define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
513 # else
514 #   define S_ISSOCK(m) 0
515 # endif
516 #endif
517
518 /* Test if something is a FIFO.  */
519 #ifndef S_ISFIFO
520 # ifdef S_IFIFO
521 #  define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
522 # else
523 #  define S_ISFIFO(m) 0
524 # endif
525 #endif
526
527 /* Approximate O_NONBLOCK.  */
528 #ifndef O_NONBLOCK
529 #define O_NONBLOCK O_NDELAY
530 #endif
531
532 /* Approximate O_NOCTTY.  */
533 #ifndef O_NOCTTY
534 #define O_NOCTTY 0
535 #endif
536
537 /* Define well known filenos if the system does not define them.  */
538 #ifndef STDIN_FILENO
539 # define STDIN_FILENO   0
540 #endif
541 #ifndef STDOUT_FILENO
542 # define STDOUT_FILENO  1
543 #endif
544 #ifndef STDERR_FILENO
545 # define STDERR_FILENO  2
546 #endif
547
548 /* Some systems have mkdir that takes a single argument. */
549 #ifdef MKDIR_TAKES_ONE_ARG
550 # define mkdir(a,b) mkdir(a)
551 #endif
552
553 /* Provide a way to print an address via printf.  */
554 #ifndef HOST_PTR_PRINTF
555 # ifdef HAVE_PRINTF_PTR
556 #  define HOST_PTR_PRINTF "%p"
557 # else
558 #  define HOST_PTR_PRINTF \
559     (sizeof (int) == sizeof (char *) ? "%x" \
560      : sizeof (long) == sizeof (char *) ? "%lx" : "%llx")
561 # endif
562 #endif /* ! HOST_PTR_PRINTF */
563
564 /* By default, colon separates directories in a path.  */
565 #ifndef PATH_SEPARATOR
566 #define PATH_SEPARATOR ':'
567 #endif
568
569 #ifndef DIR_SEPARATOR
570 #define DIR_SEPARATOR '/'
571 #endif
572
573 /* Define IS_DIR_SEPARATOR.  */
574 #ifndef DIR_SEPARATOR_2
575 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
576 #else /* DIR_SEPARATOR_2 */
577 # define IS_DIR_SEPARATOR(ch) \
578         (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
579 #endif /* DIR_SEPARATOR_2 */
580
581 /* Get libiberty declarations. */
582 #include "libiberty.h"
583
584 /* Make sure that ONLY_INT_FIELDS has an integral value.  */
585 #ifdef ONLY_INT_FIELDS
586 #undef ONLY_INT_FIELDS
587 #define ONLY_INT_FIELDS 1
588 #else
589 #define ONLY_INT_FIELDS 0
590 #endif 
591
592 /* Enumerated bitfields are safe to use unless we've been explictly told
593    otherwise or if they are signed. */
594  
595 #define USE_ENUM_BITFIELDS (__GNUC__ || (!ONLY_INT_FIELDS && ENUM_BITFIELDS_ARE_UNSIGNED))
596
597 #if USE_ENUM_BITFIELDS
598 #define ENUM_BITFIELD(TYPE) enum TYPE
599 #else
600 #define ENUM_BITFIELD(TYPE) unsigned int
601 #endif
602
603 #ifndef offsetof
604 #define offsetof(TYPE, MEMBER)  ((size_t) &((TYPE *)0)->MEMBER)
605 #endif
606
607 #endif /* __GCC_SYSTEM_H__ */