1 /* Get common system includes and various definitions and declarations
2 based on target macros.
3 Copyright (C) 2000, 2001, 2004, 2005 Free Software Foundation, Inc.
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING. If not, write to the Free
19 Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
22 /* As a special exception, if you link this library with other files,
23 some of which are compiled with GCC, to produce an executable,
24 this library does not by itself cause the resulting executable
25 to be covered by the GNU General Public License.
26 This exception does not however invalidate any other reasons why
27 the executable file might be covered by the GNU General Public License. */
32 /* System headers (e.g. stdio.h, stdlib.h, unistd.h) sometimes
33 indirectly include getopt.h. Our -I flags will cause gcc's gnu
34 getopt.h to be included, not the platform's copy. In the default
35 case, gnu getopt.h will provide us with a no-argument prototype
36 which will generate -Wstrict-prototypes warnings. None of the
37 target files actually use getopt, so it is safe to tell gnu
38 getopt.h we never need this prototype. */
39 #ifndef HAVE_DECL_GETOPT
40 #define HAVE_DECL_GETOPT 1
43 /* We want everything from the glibc headers. */
46 /* GCC supplies these headers. */
53 extern void *malloc (size_t);
57 extern void free (void *);
61 extern int atexit (void (*)(void));
65 extern void abort (void) __attribute__ ((__noreturn__
));
69 extern size_t strlen (const char *);
73 extern void *memcpy (void *, const void *, size_t);
77 extern void *memset (void *, int, size_t);
80 #else /* ! inhibit_libc */
81 /* We disable this when inhibit_libc, so that gcc can still be built without
82 needing header files first. */
83 /* ??? This is not a good solution, since prototypes may be required in
84 some cases for correct code. */
86 /* GCC supplies this header. */
89 /* All systems have this header. */
92 /* All systems have this header. */
93 #include <sys/types.h>
95 /* All systems have this header. */
102 /* GCC (fixproto) guarantees these system headers exist. */
107 /* GCC supplies this header. */
110 /* GCC (fixproto) guarantees this system headers exists. */
113 #endif /* inhibit_libc */
115 /* Define a generic NULL if one hasn't already been defined. */
120 /* GCC always provides __builtin_alloca(x). */
122 #define alloca(x) __builtin_alloca(x)
124 #ifdef ENABLE_RUNTIME_CHECKING
125 #define gcc_assert(EXPR) ((void)(!(EXPR) ? abort (), 0 : 0))
127 /* Include EXPR, so that unused variable warnings do not occur. */
128 #define gcc_assert(EXPR) ((void)(0 && (EXPR)))
130 /* Use gcc_unreachable() to mark unreachable locations (like an
131 unreachable default case of a switch. Do not use gcc_assert(0). */
132 #define gcc_unreachable() (abort ())
134 /* Filename handling macros. */
135 #include "filenames.h"
137 #endif /* ! GCC_TSYSTEM_H */