OSDN Git Service

2002-05-27 H.J. Lu (hjl@gnu.org)
[pf3gnuchains/gcc-fork.git] / gcc / tsystem.h
1 /* Get common system includes and various definitions and declarations
2    based on target macros.
3    Copyright (C) 2000, 2001 Free Software Foundation, Inc.
4
5 This file is part of GCC.
6
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.
11
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.
16
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.  */
21
22 #ifndef GCC_TSYSTEM_H
23 #define GCC_TSYSTEM_H
24
25 /* System headers (e.g. stdio.h, stdlib.h, unistd.h) sometimes
26    indirectly include getopt.h.  Our -I flags will cause gcc's gnu
27    getopt.h to be included, not the platform's copy.  In the default
28    case, gnu getopt.h will provide us with a no-argument prototype
29    which will generate -Wstrict-prototypes warnings.  None of the
30    target files actually use getopt, so it is safe to tell gnu
31    getopt.h we never need this prototype.  */
32 #ifndef HAVE_DECL_GETOPT
33 #define HAVE_DECL_GETOPT 1
34 #endif
35
36 /* GCC supplies these headers.  */
37 #include <stddef.h>
38 #include <float.h>
39
40 #ifdef inhibit_libc
41
42 #ifndef malloc
43 extern void *malloc (size_t);
44 #endif
45
46 #ifndef free
47 extern void free (void *);
48 #endif
49
50 #ifndef atexit
51 extern int atexit (void (*)(void));
52 #endif
53
54 #else /* ! inhibit_libc */
55 /* We disable this when inhibit_libc, so that gcc can still be built without
56    needing header files first.  */
57 /* ??? This is not a good solution, since prototypes may be required in
58    some cases for correct code.  */
59
60 /* GCC supplies this header.  */
61 #include <stdarg.h>
62
63 /* All systems have this header.  */
64 #include <stdio.h>
65
66 /* All systems have this header.  */
67 #include <sys/types.h>
68
69 /* All systems have this header.  */
70 #include <errno.h>
71
72 #ifndef errno
73 extern int errno;
74 #endif
75
76 #ifdef POSIX
77 #include <string.h>
78 #endif
79
80 /* GCC (fixproto) guarantees these system headers exist.  */
81 #include <stdlib.h>
82 #include <unistd.h>
83
84 /* GCC supplies this header.  */
85 #include <limits.h>
86
87 #ifdef POSIX
88 #include <time.h>
89 #endif
90
91 #endif /* inhibit_libc */
92
93 /* Define a generic NULL if one hasn't already been defined.  */
94 #ifndef NULL
95 #define NULL 0
96 #endif
97
98 #endif /* ! GCC_TSYSTEM_H */