]> gcc.gnu.org Git - gcc.git/blame - gcc/tsystem.h
re PR c++/13684 (local static object variable constructed once but ctors and dtors...
[gcc.git] / gcc / tsystem.h
CommitLineData
2e39bdbe
KG
1/* Get common system includes and various definitions and declarations
2 based on target macros.
16b97540 3 Copyright (C) 2000, 2001 Free Software Foundation, Inc.
2e39bdbe 4
1322177d 5This file is part of GCC.
2e39bdbe 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.
2e39bdbe 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.
2e39bdbe
KG
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. */
2e39bdbe 21
77c915d8
DT
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. */
28
88657302
RH
29#ifndef GCC_TSYSTEM_H
30#define GCC_TSYSTEM_H
2e39bdbe 31
16b97540
KG
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
42
40aac948
JM
43/* We want everything from the glibc headers. */
44#define _GNU_SOURCE 1
45
15e5ad76 46/* GCC supplies these headers. */
2e39bdbe 47#include <stddef.h>
15e5ad76 48#include <float.h>
2e39bdbe
KG
49
50#ifdef inhibit_libc
51
52#ifndef malloc
53extern void *malloc (size_t);
54#endif
55
56#ifndef free
57extern void free (void *);
58#endif
59
60#ifndef atexit
61extern int atexit (void (*)(void));
62#endif
63
7e7de68b
DE
64#ifndef abort
65extern void abort (void) __attribute__ ((__noreturn__));
66#endif
67
488c98d8
KH
68#ifndef strlen
69extern size_t strlen (const char *);
70#endif
71
2e39bdbe
KG
72#else /* ! inhibit_libc */
73/* We disable this when inhibit_libc, so that gcc can still be built without
74 needing header files first. */
75/* ??? This is not a good solution, since prototypes may be required in
76 some cases for correct code. */
77
2ba84f36 78/* GCC supplies this header. */
2e39bdbe
KG
79#include <stdarg.h>
80
2ba84f36 81/* All systems have this header. */
2e39bdbe
KG
82#include <stdio.h>
83
2ba84f36 84/* All systems have this header. */
2e39bdbe
KG
85#include <sys/types.h>
86
2ba84f36 87/* All systems have this header. */
2e39bdbe
KG
88#include <errno.h>
89
90#ifndef errno
91extern int errno;
92#endif
93
2ba84f36 94/* GCC (fixproto) guarantees these system headers exist. */
cbbf876b 95#include <string.h>
2e39bdbe
KG
96#include <stdlib.h>
97#include <unistd.h>
98
2ba84f36 99/* GCC supplies this header. */
2e39bdbe
KG
100#include <limits.h>
101
cbbf876b 102/* GCC (fixproto) guarantees this system headers exists. */
2e39bdbe 103#include <time.h>
2e39bdbe
KG
104
105#endif /* inhibit_libc */
106
107/* Define a generic NULL if one hasn't already been defined. */
108#ifndef NULL
109#define NULL 0
110#endif
111
88657302 112#endif /* ! GCC_TSYSTEM_H */
This page took 1.827469 seconds and 5 git commands to generate.