]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/system.h
* loop.c (check_insn_for_givs): Remove DONT_REDUCE_ADDR macro.
[thirdparty/gcc.git] / gcc / system.h
CommitLineData
c5c76735
JL
1/* Get common system includes and various definitions and declarations based
2 on autoconf macros.
0a18ddf9 3 Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
aca69483 4
1322177d 5This file is part of GCC.
1b0c6de6 6
1322177d
LB
7GCC is free software; you can redistribute it and/or modify it under
8the terms of the GNU General Public License as published by the Free
9Software Foundation; either version 2, or (at your option) any later
10version.
1b0c6de6 11
1322177d
LB
12GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13WARRANTY; without even the implied warranty of MERCHANTABILITY or
14FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15for more details.
1b0c6de6
JL
16
17You should have received a copy of the GNU General Public License
1322177d
LB
18along with GCC; see the file COPYING. If not, write to the Free
19Software Foundation, 59 Temple Place - Suite 330, Boston, MA
2002111-1307, USA. */
aca69483 21
c5c76735 22
88657302
RH
23#ifndef GCC_SYSTEM_H
24#define GCC_SYSTEM_H
aca69483 25
2ba84f36 26/* We must include stdarg.h/varargs.h before stdio.h. */
5148a72b 27#ifdef ANSI_PROTOTYPES
789f983a
KG
28#include <stdarg.h>
29#else
30#include <varargs.h>
31#endif
32
6f81b1ad
RH
33#ifndef va_copy
34# ifdef __va_copy
35# define va_copy(d,s) __va_copy((d),(s))
36# else
37# define va_copy(d,s) ((d) = (s))
38# endif
39#endif
40
d6edb99e
ZW
41#ifdef HAVE_STDDEF_H
42# include <stddef.h>
43#endif
44
aca69483 45#include <stdio.h>
51db713f
KG
46
47/* Define a generic NULL if one hasn't already been defined. */
48#ifndef NULL
49#define NULL 0
50#endif
51
54953b66 52/* The compiler is not a multi-threaded application and therefore we
3b681e9d
ZW
53 do not have to use the locking functions. In fact, using the locking
54 functions can cause the compiler to be significantly slower under
55 I/O bound conditions (such as -g -O0 on very large source files).
9c30c0e7 56
3b681e9d 57 HAVE_DECL_PUTC_UNLOCKED actually indicates whether or not the stdio
f31e826b
KG
58 code is multi-thread safe by default. If it is set to 0, then do
59 not worry about using the _unlocked functions.
0d569849 60
3b681e9d
ZW
61 fputs_unlocked, fwrite_unlocked, and fprintf_unlocked are
62 extensions and need to be prototyped by hand (since we do not
63 define _GNU_SOURCE). */
9c30c0e7 64
3b681e9d
ZW
65#if defined HAVE_DECL_PUTC_UNLOCKED && HAVE_DECL_PUTC_UNLOCKED
66
67# ifdef HAVE_PUTC_UNLOCKED
68# undef putc
69# define putc(C, Stream) putc_unlocked (C, Stream)
70# endif
71# ifdef HAVE_FPUTC_UNLOCKED
72# undef fputc
73# define fputc(C, Stream) fputc_unlocked (C, Stream)
74# endif
75
76# ifdef HAVE_FPUTS_UNLOCKED
77# undef fputs
78# define fputs(String, Stream) fputs_unlocked (String, Stream)
79# if defined (HAVE_DECL_FPUTS_UNLOCKED) && !HAVE_DECL_FPUTS_UNLOCKED
cdadb1dd 80extern int fputs_unlocked PARAMS ((const char *, FILE *));
3b681e9d
ZW
81# endif
82# endif
83# ifdef HAVE_FWRITE_UNLOCKED
84# undef fwrite
85# define fwrite(Ptr, Size, N, Stream) fwrite_unlocked (Ptr, Size, N, Stream)
86# if defined (HAVE_DECL_FWRITE_UNLOCKED) && !HAVE_DECL_FWRITE_UNLOCKED
87extern int fwrite_unlocked PARAMS ((const PTR, size_t, size_t, FILE *));
88# endif
9c30c0e7 89# endif
3b681e9d
ZW
90# ifdef HAVE_FPRINTF_UNLOCKED
91# undef fprintf
92/* We can't use a function-like macro here because we don't know if
93 we have varargs macros. */
94# define fprintf fprintf_unlocked
95# if defined (HAVE_DECL_FPRINTF_UNLOCKED) && !HAVE_DECL_FPRINTF_UNLOCKED
96extern int fprintf_unlocked PARAMS ((FILE *, const char *, ...));
97# endif
98# endif
99
54953b66
UD
100#endif
101
0d569849 102/* ??? Glibc's fwrite/fread_unlocked macros cause
1c99d804
RH
103 "warning: signed and unsigned type in conditional expression". */
104#undef fread_unlocked
105#undef fwrite_unlocked
106
f6bbde28
ZW
107/* There are an extraordinary number of issues with <ctype.h>.
108 The last straw is that it varies with the locale. Use libiberty's
109 replacement instead. */
110#include <safe-ctype.h>
aca69483 111
aca69483 112#include <sys/types.h>
c5c76735 113
aca69483
KG
114#include <errno.h>
115
6c889b67 116#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO
aca69483
KG
117extern int errno;
118#endif
119
87608693
KG
120/* Some of glibc's string inlines cause warnings. Plus we'd rather
121 rely on (and therefore test) GCC's string builtins. */
122#define __NO_STRING_INLINES
123
ccc7d11a 124#ifdef STRING_WITH_STRINGS
aca69483 125# include <string.h>
ccc7d11a 126# include <strings.h>
aca69483 127#else
ccc7d11a
KG
128# ifdef HAVE_STRING_H
129# include <string.h>
130# else
131# ifdef HAVE_STRINGS_H
132# include <strings.h>
133# endif
aca69483
KG
134# endif
135#endif
136
137#ifdef HAVE_STDLIB_H
138# include <stdlib.h>
139#endif
140
eaf4e618
ZW
141/* If we don't have an overriding definition, set SUCCESS_EXIT_CODE and
142 FATAL_EXIT_CODE to EXIT_SUCCESS and EXIT_FAILURE respectively,
143 or 0 and 1 if those macros are not defined. */
144#ifndef SUCCESS_EXIT_CODE
145# ifdef EXIT_SUCCESS
146# define SUCCESS_EXIT_CODE EXIT_SUCCESS
147# else
148# define SUCCESS_EXIT_CODE 0
149# endif
150#endif
151
152#ifndef FATAL_EXIT_CODE
153# ifdef EXIT_FAILURE
154# define FATAL_EXIT_CODE EXIT_FAILURE
155# else
156# define FATAL_EXIT_CODE 1
157# endif
158#endif
159
aca69483
KG
160#ifdef HAVE_UNISTD_H
161# include <unistd.h>
162#endif
163
164#ifdef HAVE_SYS_PARAM_H
165# include <sys/param.h>
23d1aac4 166/* We use this identifier later and it appears in some vendor param.h's. */
655781b7 167# undef PREFETCH
aca69483
KG
168#endif
169
170#if HAVE_LIMITS_H
171# include <limits.h>
172#endif
173
75e93faa
ZW
174/* Get definitions of HOST_WIDE_INT and HOST_WIDEST_INT. */
175#include "hwint.h"
f80d6fd7 176
5297e085
KG
177/* A macro to determine whether a VALUE lies inclusively within a
178 certain range without evaluating the VALUE more than once. This
179 macro won't warn if the VALUE is unsigned and the LOWER bound is
180 zero, as it would e.g. with "VALUE >= 0 && ...". Note the LOWER
181 bound *is* evaluated twice, and LOWER must not be greater than
182 UPPER. However the bounds themselves can be either positive or
183 negative. */
184#define IN_RANGE(VALUE, LOWER, UPPER) \
cf403648 185 ((unsigned HOST_WIDE_INT) ((VALUE) - (LOWER)) <= ((UPPER) - (LOWER)))
5297e085 186
f12bc141
ZW
187/* Infrastructure for defining missing _MAX and _MIN macros. Note that
188 macros defined with these cannot be used in #if. */
189
190/* The extra casts work around common compiler bugs. */
191#define INTTYPE_SIGNED(t) (! ((t) 0 < (t) -1))
192/* The outer cast is needed to work around a bug in Cray C 5.0.3.0.
193 It is necessary at least when t == time_t. */
194#define INTTYPE_MINIMUM(t) ((t) (INTTYPE_SIGNED (t) \
195 ? ~ (t) 0 << (sizeof(t) * CHAR_BIT - 1) : (t) 0))
196#define INTTYPE_MAXIMUM(t) ((t) (~ (t) 0 - INTTYPE_MINIMUM (t)))
197
198/* Use that infrastructure to provide a few constants. */
199#ifndef UCHAR_MAX
200# define UCHAR_MAX INTTYPE_MAXIMUM (unsigned char)
201#endif
202
aca69483
KG
203#ifdef TIME_WITH_SYS_TIME
204# include <sys/time.h>
205# include <time.h>
206#else
207# if HAVE_SYS_TIME_H
e572c0c6 208# include <sys/time.h>
aca69483 209# else
e572c0c6
KG
210# ifdef HAVE_TIME_H
211# include <time.h>
212# endif
213# endif
aca69483
KG
214#endif
215
216#ifdef HAVE_FCNTL_H
217# include <fcntl.h>
218#else
e572c0c6
KG
219# ifdef HAVE_SYS_FILE_H
220# include <sys/file.h>
221# endif
aca69483
KG
222#endif
223
224#ifndef SEEK_SET
225# define SEEK_SET 0
226# define SEEK_CUR 1
227# define SEEK_END 2
228#endif
229#ifndef F_OK
230# define F_OK 0
231# define X_OK 1
232# define W_OK 2
233# define R_OK 4
234#endif
e572c0c6
KG
235#ifndef O_RDONLY
236# define O_RDONLY 0
237#endif
238#ifndef O_WRONLY
239# define O_WRONLY 1
240#endif
aca69483 241
36b8337d
KG
242/* Some systems define these in, e.g., param.h. We undefine these names
243 here to avoid the warnings. We prefer to use our definitions since we
244 know they are correct. */
245
246#undef MIN
247#undef MAX
248#define MIN(X,Y) ((X) < (Y) ? (X) : (Y))
249#define MAX(X,Y) ((X) > (Y) ? (X) : (Y))
250
13799af3
MM
251/* Returns the least number N such that N * Y >= X. */
252#define CEIL(x,y) (((x) + (y) - 1) / (y))
253
e9831ca0
KG
254#ifdef HAVE_SYS_WAIT_H
255#include <sys/wait.h>
256#endif
257
258#ifndef WIFSIGNALED
259#define WIFSIGNALED(S) (((S) & 0xff) != 0 && ((S) & 0xff) != 0x7f)
260#endif
261#ifndef WTERMSIG
262#define WTERMSIG(S) ((S) & 0x7f)
263#endif
264#ifndef WIFEXITED
265#define WIFEXITED(S) (((S) & 0xff) == 0)
266#endif
267#ifndef WEXITSTATUS
268#define WEXITSTATUS(S) (((S) & 0xff00) >> 8)
269#endif
8fa213ac
PDM
270#ifndef WSTOPSIG
271#define WSTOPSIG WEXITSTATUS
272#endif
15dda4d3
KG
273#ifndef WCOREDUMP
274#define WCOREDUMP(S) ((S) & WCOREFLG)
275#endif
276#ifndef WCOREFLG
277#define WCOREFLG 0200
278#endif
e9831ca0 279
f31e826b
KG
280/* The HAVE_DECL_* macros are three-state, undefined, 0 or 1. If they
281 are defined to 0 then we must provide the relevant declaration
282 here. These checks will be in the undefined state while configure
283 is running so be careful to test "defined (HAVE_DECL_*)". */
aca69483 284
f31e826b 285#if defined (HAVE_DECL_ATOF) && !HAVE_DECL_ATOF
d4d4ae5f 286extern double atof PARAMS ((const char *));
8f81384f
KG
287#endif
288
f31e826b 289#if defined (HAVE_DECL_ATOL) && !HAVE_DECL_ATOL
d4d4ae5f 290extern long atol PARAMS ((const char *));
8f81384f
KG
291#endif
292
f31e826b 293#if defined (HAVE_DECL_FREE) && !HAVE_DECL_FREE
d4d4ae5f 294extern void free PARAMS ((PTR));
aca69483
KG
295#endif
296
f31e826b 297#if defined (HAVE_DECL_GETCWD) && !HAVE_DECL_GETCWD
d4d4ae5f 298extern char *getcwd PARAMS ((char *, size_t));
6cd5dccd
KG
299#endif
300
f31e826b 301#if defined (HAVE_DECL_GETENV) && !HAVE_DECL_GETENV
d4d4ae5f 302extern char *getenv PARAMS ((const char *));
79e11844
KG
303#endif
304
ebb13e7e 305#if defined (HAVE_DECL_GETOPT) && !HAVE_DECL_GETOPT
fc608b03 306extern int getopt PARAMS ((int, char * const *, const char *));
ebb13e7e
RK
307#endif
308
f31e826b 309#if defined (HAVE_DECL_GETWD) && !HAVE_DECL_GETWD
d4d4ae5f 310extern char *getwd PARAMS ((char *));
6cd5dccd
KG
311#endif
312
f31e826b 313#if defined (HAVE_DECL_SBRK) && !HAVE_DECL_SBRK
d4d4ae5f 314extern PTR sbrk PARAMS ((int));
8f81384f
KG
315#endif
316
f31e826b 317#if defined (HAVE_DECL_STRSTR) && !HAVE_DECL_STRSTR
d4d4ae5f 318extern char *strstr PARAMS ((const char *, const char *));
d3d5cc97
JL
319#endif
320
c5c76735
JL
321#ifdef HAVE_MALLOC_H
322#include <malloc.h>
323#endif
324
f31e826b 325#if defined (HAVE_DECL_MALLOC) && !HAVE_DECL_MALLOC
d4d4ae5f 326extern PTR malloc PARAMS ((size_t));
c5c76735
JL
327#endif
328
f31e826b 329#if defined (HAVE_DECL_CALLOC) && !HAVE_DECL_CALLOC
d4d4ae5f 330extern PTR calloc PARAMS ((size_t, size_t));
c5c76735
JL
331#endif
332
f31e826b 333#if defined (HAVE_DECL_REALLOC) && !HAVE_DECL_REALLOC
d4d4ae5f 334extern PTR realloc PARAMS ((PTR, size_t));
c5c76735
JL
335#endif
336
759af044 337/* If the system doesn't provide strsignal, we get it defined in
2ba84f36 338 libiberty but no declaration is supplied. */
0a18ddf9
AS
339#if !defined (HAVE_STRSIGNAL) \
340 || (defined (HAVE_DECL_STRSIGNAL) && !HAVE_DECL_STRSIGNAL)
759af044
KG
341# ifndef strsignal
342extern const char *strsignal PARAMS ((int));
007e8d2a 343# endif
759af044 344#endif
007e8d2a 345
d2cabf16 346#ifdef HAVE_GETRLIMIT
f31e826b 347# if defined (HAVE_DECL_GETRLIMIT) && !HAVE_DECL_GETRLIMIT
d2cabf16 348# ifndef getrlimit
d4d4ae5f
KG
349# ifdef ANSI_PROTOTYPES
350struct rlimit;
351# endif
352extern int getrlimit PARAMS ((int, struct rlimit *));
d2cabf16
KG
353# endif
354# endif
355#endif
356
357#ifdef HAVE_SETRLIMIT
f31e826b 358# if defined (HAVE_DECL_SETRLIMIT) && !HAVE_DECL_SETRLIMIT
d2cabf16 359# ifndef setrlimit
d4d4ae5f
KG
360# ifdef ANSI_PROTOTYPES
361struct rlimit;
362# endif
363extern int setrlimit PARAMS ((int, const struct rlimit *));
d2cabf16
KG
364# endif
365# endif
366#endif
367
e9b4fabf 368/* HAVE_VOLATILE only refers to the stage1 compiler. We also check
2ba84f36 369 __STDC__ and assume gcc sets it and has volatile in stage >=2. */
e9b4fabf
JL
370#if !defined(HAVE_VOLATILE) && !defined(__STDC__) && !defined(volatile)
371#define volatile
372#endif
373
f31e826b 374#if defined (HAVE_DECL_ABORT) && !HAVE_DECL_ABORT
d4d4ae5f 375extern void abort PARAMS ((void));
2a611d21 376#endif
d4ba0ead 377
61d0346d 378/* 1 if we have C99 designated initializers. */
18922061 379#if !defined(HAVE_DESIGNATED_INITIALIZERS)
61d0346d
NB
380#define HAVE_DESIGNATED_INITIALIZERS \
381 ((GCC_VERSION >= 2007) || (__STDC_VERSION__ >= 199901L))
18922061 382#endif
61d0346d 383
d6edb99e
ZW
384/* 1 if we have _Bool. */
385#ifndef HAVE__BOOL
386# define HAVE__BOOL \
387 ((GCC_VERSION >= 3000) || (__STDC_VERSION__ >= 199901L))
388#endif
389
390
a05e22b8
RH
391#if HAVE_SYS_STAT_H
392# include <sys/stat.h>
393#endif
9855b854
MN
394
395/* Test if something is a normal file. */
396#ifndef S_ISREG
397#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
398#endif
399
400/* Test if something is a directory. */
401#ifndef S_ISDIR
402#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
403#endif
404
6458033d
ZW
405/* Test if something is a character special file. */
406#ifndef S_ISCHR
407#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
408#endif
409
be3dad6f
PDM
410/* Test if something is a block special file. */
411#ifndef S_ISBLK
412#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
413#endif
414
6458033d
ZW
415/* Test if something is a socket. */
416#ifndef S_ISSOCK
417# ifdef S_IFSOCK
418# define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
419# else
420# define S_ISSOCK(m) 0
421# endif
422#endif
423
424/* Test if something is a FIFO. */
425#ifndef S_ISFIFO
426# ifdef S_IFIFO
427# define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
428# else
429# define S_ISFIFO(m) 0
430# endif
431#endif
432
433/* Approximate O_NONBLOCK. */
434#ifndef O_NONBLOCK
435#define O_NONBLOCK O_NDELAY
436#endif
437
438/* Approximate O_NOCTTY. */
439#ifndef O_NOCTTY
440#define O_NOCTTY 0
441#endif
442
f3692274
ME
443/* Define well known filenos if the system does not define them. */
444#ifndef STDIN_FILENO
445# define STDIN_FILENO 0
446#endif
447#ifndef STDOUT_FILENO
448# define STDOUT_FILENO 1
449#endif
924d8a7c 450#ifndef STDERR_FILENO
f3692274
ME
451# define STDERR_FILENO 2
452#endif
453
2ba84f36 454/* Some systems have mkdir that takes a single argument. */
75923b2f
MK
455#ifdef MKDIR_TAKES_ONE_ARG
456# define mkdir(a,b) mkdir(a)
457#endif
458
1eb14644
KG
459/* Provide a way to print an address via printf. */
460#ifndef HOST_PTR_PRINTF
461# ifdef HAVE_PRINTF_PTR
462# define HOST_PTR_PRINTF "%p"
463# else
464# define HOST_PTR_PRINTF \
465 (sizeof (int) == sizeof (char *) ? "%x" \
466 : sizeof (long) == sizeof (char *) ? "%lx" : "%llx")
467# endif
468#endif /* ! HOST_PTR_PRINTF */
469
d5b6516d
MK
470/* By default, colon separates directories in a path. */
471#ifndef PATH_SEPARATOR
472#define PATH_SEPARATOR ':'
473#endif
474
475#ifndef DIR_SEPARATOR
476#define DIR_SEPARATOR '/'
477#endif
478
479/* Define IS_DIR_SEPARATOR. */
480#ifndef DIR_SEPARATOR_2
c5c0b3d9 481# define IS_DIR_SEPARATOR(CH) ((CH) == DIR_SEPARATOR)
d5b6516d 482#else /* DIR_SEPARATOR_2 */
c5c0b3d9
RK
483# define IS_DIR_SEPARATOR(CH) \
484 (((CH) == DIR_SEPARATOR) || ((CH) == DIR_SEPARATOR_2))
d5b6516d
MK
485#endif /* DIR_SEPARATOR_2 */
486
c5c0b3d9
RK
487/* Say how to test for an absolute pathname. On Unix systems, this is if
488 it starts with a leading slash or a '$', the latter meaning the value of
14b493d6 489 an environment variable is to be used. On machine with DOS-based
c5c0b3d9
RK
490 file systems, it is also absolute if it starts with a drive identifier. */
491#ifdef HAVE_DOS_BASED_FILE_SYSTEM
492#define IS_ABSOLUTE_PATHNAME(STR) \
493 (IS_DIR_SEPARATOR ((STR)[0]) || (STR)[0] == '$' \
494 || ((STR)[0] != '\0' && (STR)[1] == ':' && IS_DIR_SEPARATOR ((STR)[2])))
495#else
496#define IS_ABSOLUTE_PATHNAME(STR) \
497 (IS_DIR_SEPARATOR ((STR)[0]) || (STR)[0] == '$')
498#endif
499
2ba84f36 500/* Get libiberty declarations. */
2778b98d 501#include "libiberty.h"
4bc5fbd4 502#include "symcat.h"
2778b98d 503
49009afd
JL
504/* Provide a default for the HOST_BIT_BUCKET.
505 This suffices for POSIX-like hosts. */
506
507#ifndef HOST_BIT_BUCKET
508#define HOST_BIT_BUCKET "/dev/null"
509#endif
510
de94b46c
KG
511/* Be conservative and only use enum bitfields with GCC. Likewise for
512 char bitfields.
9612ab65 513 FIXME: provide a complete autoconf test for buggy enum bitfields. */
c149cc37 514
9612ab65 515#if (GCC_VERSION > 2000)
c149cc37 516#define ENUM_BITFIELD(TYPE) enum TYPE
de94b46c 517#define CHAR_BITFIELD unsigned char
c149cc37
RL
518#else
519#define ENUM_BITFIELD(TYPE) unsigned int
de94b46c 520#define CHAR_BITFIELD unsigned int
c149cc37
RL
521#endif
522
e0125cf3 523#ifndef offsetof
cf403648 524#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *) 0)->MEMBER)
e0125cf3 525#endif
c149cc37 526
7de9cc38
KG
527/* Traditional C cannot initialize union members of structs. Provide
528 a macro which expands appropriately to handle it. This only works
f63d1bf7 529 if you intend to initialize the union member to zero since it relies
7de9cc38
KG
530 on default initialization to zero in the traditional C case. */
531#ifdef __STDC__
532#define UNION_INIT_ZERO , {0}
533#else
534#define UNION_INIT_ZERO
535#endif
536
fbfc1192
ZW
537/* Various error reporting routines want to use __FUNCTION__. */
538#if (GCC_VERSION < 2007)
791ef777 539#ifndef __FUNCTION__
fbfc1192 540#define __FUNCTION__ "?"
791ef777 541#endif /* ! __FUNCTION__ */
fbfc1192
ZW
542#endif
543
2c3fcba6
ZW
544/* __builtin_expect(A, B) evaluates to A, but notifies the compiler that
545 the most likely value of A is B. This feature was added at some point
546 between 2.95 and 3.0. Let's use 3.0 as the lower bound for now. */
547#if (GCC_VERSION < 3000)
548#define __builtin_expect(a, b) (a)
549#endif
550
d6edb99e 551/* Provide some sort of boolean type. We use stdbool.h if it's
2f78c311
ZW
552 available. This must be after all inclusion of system headers,
553 as some of them will mess us up. */
d6edb99e
ZW
554#undef bool
555#undef true
556#undef false
557#undef TRUE
558#undef FALSE
559
560#ifdef HAVE_STDBOOL_H
561# include <stdbool.h>
562#else
563# if !HAVE__BOOL
564typedef char _Bool;
565# endif
566# define bool _Bool
567# define true 1
568# define false 0
569#endif
570
571#define TRUE true
572#define FALSE false
573
f4ce9d90
KG
574/* As the last action in this file, we poison the identifiers that
575 shouldn't be used. Note, luckily gcc-3.0's token-based integrated
576 preprocessor won't trip on poisoned identifiers that arrive from
577 the expansion of macros. E.g. #define strrchr rindex, won't error
578 if rindex is poisoned after this directive is issued and later on
579 strrchr is called.
580
581 Note: We define bypass macros for the few cases where we really
582 want to use the libc memory allocation routines. Otherwise we
583 insist you use the "x" versions from libiberty. */
584
585#define really_call_malloc malloc
586#define really_call_calloc calloc
587#define really_call_realloc realloc
588
4977bab6
ZW
589#if defined(FLEX_SCANNER) || defined(YYBISON)
590/* Flex and bison use malloc and realloc. Yuk. Note that this means
32dd366d 591 really_call_* cannot be used in a .l or .y file. */
4977bab6
ZW
592#define malloc xmalloc
593#define realloc xrealloc
594#endif
595
f4ce9d90
KG
596#if (GCC_VERSION >= 3000)
597
77b84559
KG
598/* Note autoconf checks for prototype declarations and includes
599 system.h while doing so. Only poison these tokens if actually
600 compiling gcc, so that the autoconf declaration tests for malloc
601 etc don't spuriously fail. */
602#ifdef IN_GCC
8a0e5115
KG
603#undef calloc
604#undef strdup
e2500fed
GK
605 #pragma GCC poison calloc strdup
606
4977bab6 607#if !defined(FLEX_SCANNER) && !defined(YYBISON)
e2500fed
GK
608#undef malloc
609#undef realloc
610 #pragma GCC poison malloc realloc
611#endif
41441dc7
NB
612
613/* Old target macros that have moved to the target hooks structure. */
614 #pragma GCC poison ASM_OPEN_PAREN ASM_CLOSE_PAREN \
615 FUNCTION_PROLOGUE FUNCTION_EPILOGUE \
616 FUNCTION_END_PROLOGUE FUNCTION_BEGIN_EPILOGUE \
617 DECL_MACHINE_ATTRIBUTES COMP_TYPE_ATTRIBUTES INSERT_ATTRIBUTES \
618 VALID_MACHINE_DECL_ATTRIBUTE VALID_MACHINE_TYPE_ATTRIBUTE \
619 SET_DEFAULT_TYPE_ATTRIBUTES SET_DEFAULT_DECL_ATTRIBUTES \
620 MERGE_MACHINE_TYPE_ATTRIBUTES MERGE_MACHINE_DECL_ATTRIBUTES \
aa6ad1a6 621 MD_INIT_BUILTINS MD_EXPAND_BUILTIN ASM_OUTPUT_CONSTRUCTOR \
44a147ad 622 ASM_OUTPUT_DESTRUCTOR SIGNED_CHAR_SPEC MAX_CHAR_TYPE_SIZE \
fb49053f 623 WCHAR_UNSIGNED UNIQUE_SECTION SELECT_SECTION SELECT_RTX_SECTION \
3961e8fe 624 ENCODE_SECTION_INFO STRIP_NAME_ENCODING ASM_GLOBALIZE_LABEL \
dcefdf67 625 ASM_OUTPUT_MI_THUNK CONST_COSTS RTX_COSTS DEFAULT_RTX_COSTS \
2f9bb7c5 626 ADDRESS_COST MACHINE_DEPENDENT_REORG
aa6ad1a6 627
e2500fed 628/* Other obsolete target macros, or macros that used to be in target
006946e4
JM
629 headers and were not used, and may be obsolete or may never have
630 been used. */
c08f71aa 631 #pragma GCC poison INT_ASM_OP ASM_OUTPUT_EH_REGION_BEG CPP_PREDEFINES \
ed722f66
JM
632 ASM_OUTPUT_EH_REGION_END ASM_OUTPUT_LABELREF_AS_INT \
633 DOESNT_NEED_UNWINDER EH_TABLE_LOOKUP OBJC_SELECTORS_WITHOUT_LABELS \
16c484c7 634 OMIT_EH_TABLE EASY_DIV_EXPR IMPLICIT_FIX_EXPR \
006946e4 635 LONGJMP_RESTORE_FROM_STACK MAX_INT_TYPE_SIZE ASM_IDENTIFY_GCC \
c99d986a 636 STDC_VALUE TRAMPOLINE_ALIGN ASM_IDENTIFY_GCC_AFTER_SOURCE \
f458d1d5 637 SLOW_ZERO_EXTEND SUBREG_REGNO_OFFSET DWARF_LINE_MIN_INSTR_LENGTH \
a11eba95 638 TRADITIONAL_RETURN_FLOAT NO_BUILTIN_SIZE_TYPE \
fc881338
RH
639 NO_BUILTIN_PTRDIFF_TYPE NO_BUILTIN_WCHAR_TYPE NO_BUILTIN_WINT_TYPE \
640 BLOCK_PROFILER BLOCK_PROFILER_CODE FUNCTION_BLOCK_PROFILER \
641 FUNCTION_BLOCK_PROFILER_EXIT MACHINE_STATE_SAVE \
c0667597 642 MACHINE_STATE_RESTORE SCCS_DIRECTIVE SECTION_ASM_OP \
e5bcbd89 643 ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL ASM_OUTPUT_INTERNAL_LABEL \
0d569849 644 OBJC_PROLOGUE ALLOCATE_TRAMPOLINE HANDLE_PRAGMA
aa6ad1a6 645
e2500fed
GK
646/* Hooks that are no longer used. */
647 #pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE \
648 LANG_HOOKS_MARK_TREE
649
77b84559 650#endif /* IN_GCC */
f4ce9d90 651
8e944909
KG
652/* Note: not all uses of the `index' token (e.g. variable names and
653 structure members) have been eliminated. */
654#undef bcopy
8a0e5115
KG
655#undef bzero
656#undef bcmp
657#undef rindex
8e944909 658 #pragma GCC poison bcopy bzero bcmp rindex
f4ce9d90
KG
659
660#endif /* GCC >= 3.0 */
661
88657302 662#endif /* ! GCC_SYSTEM_H */