* MAINTAINERS: Update my email address.
[official-gcc.git] / gcc / tsystem.h
blobf24bab78cc5e4258fc8784ddafe5d5f227dee500
1 /* Get common system includes and various definitions and declarations
2 based on target macros.
3 Copyright (C) 2000, 2001 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
10 version.
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
15 for more details.
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, 59 Temple Place - Suite 330, Boston, MA
20 02111-1307, USA. */
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. */
29 #ifndef GCC_TSYSTEM_H
30 #define GCC_TSYSTEM_H
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
41 #endif
43 /* GCC supplies these headers. */
44 #include <stddef.h>
45 #include <float.h>
47 #ifdef inhibit_libc
49 #ifndef malloc
50 extern void *malloc (size_t);
51 #endif
53 #ifndef free
54 extern void free (void *);
55 #endif
57 #ifndef atexit
58 extern int atexit (void (*)(void));
59 #endif
61 #ifndef abort
62 extern void abort (void) __attribute__ ((__noreturn__));
63 #endif
65 #ifndef strlen
66 extern size_t strlen (const char *);
67 #endif
69 #else /* ! inhibit_libc */
70 /* We disable this when inhibit_libc, so that gcc can still be built without
71 needing header files first. */
72 /* ??? This is not a good solution, since prototypes may be required in
73 some cases for correct code. */
75 /* GCC supplies this header. */
76 #include <stdarg.h>
78 /* All systems have this header. */
79 #include <stdio.h>
81 /* All systems have this header. */
82 #include <sys/types.h>
84 /* All systems have this header. */
85 #include <errno.h>
87 #ifndef errno
88 extern int errno;
89 #endif
91 /* GCC (fixproto) guarantees these system headers exist. */
92 #include <string.h>
93 #include <stdlib.h>
94 #include <unistd.h>
96 /* GCC supplies this header. */
97 #include <limits.h>
99 /* GCC (fixproto) guarantees this system headers exists. */
100 #include <time.h>
102 #endif /* inhibit_libc */
104 /* Define a generic NULL if one hasn't already been defined. */
105 #ifndef NULL
106 #define NULL 0
107 #endif
109 #endif /* ! GCC_TSYSTEM_H */