X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Ftsystem.h;h=cbd21dc1ed8020e05e4dfafcdc955f3885bcd31d;hb=afb8cabf7ff84281c94922e3d2a7e6eb73e6b157;hp=4c21f810f1b2c39c94e75e4349a4cf733a7498e2;hpb=597183a713c90c46dc9c299d1a53660733e5ffc1;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/tsystem.h b/gcc/tsystem.h index 4c21f810f1b..cbd21dc1ed8 100644 --- a/gcc/tsystem.h +++ b/gcc/tsystem.h @@ -1,26 +1,33 @@ /* Get common system includes and various definitions and declarations based on target macros. - Copyright (C) 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 2000, 2001, 2004, 2005 Free Software Foundation, Inc. -This file is part of GNU CC. +This file is part of GCC. -GNU CC is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. -GNU CC is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. You should have received a copy of the GNU General Public License -along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +along with GCC; see the file COPYING. If not, write to the Free +Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301, USA. */ -#ifndef __GCC_TSYSTEM_H__ -#define __GCC_TSYSTEM_H__ +/* As a special exception, if you link this library with other files, + some of which are compiled with GCC, to produce an executable, + this library does not by itself cause the resulting executable + to be covered by the GNU General Public License. + This exception does not however invalidate any other reasons why + the executable file might be covered by the GNU General Public License. */ + +#ifndef GCC_TSYSTEM_H +#define GCC_TSYSTEM_H /* System headers (e.g. stdio.h, stdlib.h, unistd.h) sometimes indirectly include getopt.h. Our -I flags will cause gcc's gnu @@ -33,8 +40,12 @@ Boston, MA 02111-1307, USA. */ #define HAVE_DECL_GETOPT 1 #endif -/* GCC supplies this header. */ +/* We want everything from the glibc headers. */ +#define _GNU_SOURCE 1 + +/* GCC supplies these headers. */ #include +#include #ifdef inhibit_libc @@ -50,42 +61,54 @@ extern void free (void *); extern int atexit (void (*)(void)); #endif +#ifndef abort +extern void abort (void) __attribute__ ((__noreturn__)); +#endif + +#ifndef strlen +extern size_t strlen (const char *); +#endif + +#ifndef memcpy +extern void *memcpy (void *, const void *, size_t); +#endif + +#ifndef memset +extern void *memset (void *, int, size_t); +#endif + #else /* ! inhibit_libc */ /* We disable this when inhibit_libc, so that gcc can still be built without needing header files first. */ /* ??? This is not a good solution, since prototypes may be required in some cases for correct code. */ -/* GCC supplies this header. */ +/* GCC supplies this header. */ #include -/* All systems have this header. */ +/* All systems have this header. */ #include -/* All systems have this header. */ +/* All systems have this header. */ #include -/* All systems have this header. */ +/* All systems have this header. */ #include #ifndef errno extern int errno; #endif -#ifdef POSIX +/* GCC (fixproto) guarantees these system headers exist. */ #include -#endif - -/* GCC (fixproto) guarantees these system headers exist. */ #include #include -/* GCC supplies this header. */ +/* GCC supplies this header. */ #include -#ifdef POSIX +/* GCC (fixproto) guarantees this system headers exists. */ #include -#endif #endif /* inhibit_libc */ @@ -94,4 +117,21 @@ extern int errno; #define NULL 0 #endif -#endif /* __GCC_TSYSTEM_H__ */ +/* GCC always provides __builtin_alloca(x). */ +#undef alloca +#define alloca(x) __builtin_alloca(x) + +#ifdef ENABLE_RUNTIME_CHECKING +#define gcc_assert(EXPR) ((void)(!(EXPR) ? abort (), 0 : 0)) +#else +/* Include EXPR, so that unused variable warnings do not occur. */ +#define gcc_assert(EXPR) ((void)(0 && (EXPR))) +#endif +/* Use gcc_unreachable() to mark unreachable locations (like an + unreachable default case of a switch. Do not use gcc_assert(0). */ +#define gcc_unreachable() (abort ()) + +/* Filename handling macros. */ +#include "filenames.h" + +#endif /* ! GCC_TSYSTEM_H */