1 /* Get common system includes and various definitions and declarations
2 based on target macros.
3 Copyright (C) 2000, 2001, 2004, 2005, 2009 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 3, 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 Under Section 7 of GPL version 3, you are granted additional
18 permissions described in the GCC Runtime Library Exception, version
19 3.1, as published by the Free Software Foundation.
21 You should have received a copy of the GNU General Public License and
22 a copy of the GCC Runtime Library Exception along with this program;
23 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
24 <http://www.gnu.org/licenses/>. */
29 /* System headers (e.g. stdio.h, stdlib.h, unistd.h) sometimes
30 indirectly include getopt.h. Our -I flags will cause gcc's gnu
31 getopt.h to be included, not the platform's copy. In the default
32 case, gnu getopt.h will provide us with a no-argument prototype
33 which will generate -Wstrict-prototypes warnings. None of the
34 target files actually use getopt, so it is safe to tell gnu
35 getopt.h we never need this prototype. */
36 #ifndef HAVE_DECL_GETOPT
37 #define HAVE_DECL_GETOPT 1
40 /* We want everything from the glibc headers. */
43 /* GCC supplies these headers. */
50 extern void *malloc (size_t);
54 extern void free (void *);
58 extern int atexit (void (*)(void));
62 extern void abort (void) __attribute__ ((__noreturn__
));
66 extern size_t strlen (const char *);
70 extern void *memcpy (void *, const void *, size_t);
74 extern void *memset (void *, int, size_t);
77 #else /* ! inhibit_libc */
78 /* We disable this when inhibit_libc, so that gcc can still be built without
79 needing header files first. */
80 /* ??? This is not a good solution, since prototypes may be required in
81 some cases for correct code. */
83 /* GCC supplies this header. */
86 /* All systems have this header. */
89 /* All systems have this header. */
90 #include <sys/types.h>
95 /* All systems have this header. */
103 /* GCC (fixproto) guarantees these system headers exist. */
108 /* GCC supplies this header. */
111 /* GCC (fixproto) guarantees this system headers exists. */
114 #endif /* inhibit_libc */
116 /* Define a generic NULL if one hasn't already been defined. */
121 /* GCC always provides __builtin_alloca(x). */
123 #define alloca(x) __builtin_alloca(x)
125 #ifdef ENABLE_RUNTIME_CHECKING
126 #define gcc_assert(EXPR) ((void)(!(EXPR) ? abort (), 0 : 0))
128 /* Include EXPR, so that unused variable warnings do not occur. */
129 #define gcc_assert(EXPR) ((void)(0 && (EXPR)))
131 /* Use gcc_unreachable() to mark unreachable locations (like an
132 unreachable default case of a switch. Do not use gcc_assert(0). */
133 #define gcc_unreachable() (abort ())
135 /* Filename handling macros. */
136 #include "filenames.h"
138 #endif /* ! GCC_TSYSTEM_H */