tsystem.h revision 117395
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 5This file is part of GCC. 6 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. 11 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. 16 17You should have received a copy of the GNU General Public License 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. */ 21 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 29 30#ifndef GCC_TSYSTEM_H 31#define GCC_TSYSTEM_H 32 33/* System headers (e.g. stdio.h, stdlib.h, unistd.h) sometimes 34 indirectly include getopt.h. Our -I flags will cause gcc's gnu 35 getopt.h to be included, not the platform's copy. In the default 36 case, gnu getopt.h will provide us with a no-argument prototype 37 which will generate -Wstrict-prototypes warnings. None of the 38 target files actually use getopt, so it is safe to tell gnu 39 getopt.h we never need this prototype. */ 40#ifndef HAVE_DECL_GETOPT 41#define HAVE_DECL_GETOPT 1 42#endif 43 44/* GCC supplies these headers. */ 45#include <stddef.h> 46#include <float.h> 47 48#ifdef inhibit_libc 49 50#ifndef malloc 51extern void *malloc (size_t); 52#endif 53 54#ifndef free 55extern void free (void *); 56#endif 57 58#ifndef atexit 59extern int atexit (void (*)(void)); 60#endif 61 62#else /* ! inhibit_libc */ 63/* We disable this when inhibit_libc, so that gcc can still be built without 64 needing header files first. */ 65/* ??? This is not a good solution, since prototypes may be required in 66 some cases for correct code. */ 67 68/* GCC supplies this header. */ 69#include <stdarg.h> 70 71/* All systems have this header. */ 72#include <stdio.h> 73 74/* All systems have this header. */ 75#include <sys/types.h> 76 77/* All systems have this header. */ 78#include <errno.h> 79 80#ifndef errno 81extern int errno; 82#endif 83 84#ifdef POSIX 85#include <string.h> 86#endif 87 88/* GCC (fixproto) guarantees these system headers exist. */ 89#include <stdlib.h> 90#include <unistd.h> 91 92/* GCC supplies this header. */ 93#include <limits.h> 94 95#ifdef POSIX 96#include <time.h> 97#endif 98 99#endif /* inhibit_libc */ 100 101/* Define a generic NULL if one hasn't already been defined. */ 102#ifndef NULL 103#define NULL 0 104#endif 105 106#endif /* ! GCC_TSYSTEM_H */ 107