OSDN Git Service

2010-04-20 Richard Guenther <rguenther@suse.de>
[pf3gnuchains/gcc-fork.git] / gcc / tsystem.h
index 511d5cf..fc7713c 100644 (file)
@@ -1,12 +1,12 @@
 /* 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, 2009 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
 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
+Software Foundation; either version 3, or (at your option) any later
 version.
 
 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
@@ -14,10 +14,14 @@ 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 GCC; see the file COPYING.  If not, write to the Free
-Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.  */
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
 
 #ifndef GCC_TSYSTEM_H
 #define GCC_TSYSTEM_H
@@ -33,6 +37,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #define HAVE_DECL_GETOPT 1
 #endif
 
+/* We want everything from the glibc headers.  */
+#define _GNU_SOURCE 1
+
 /* GCC supplies these headers.  */
 #include <stddef.h>
 #include <float.h>
@@ -51,6 +58,22 @@ 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.  */
@@ -73,7 +96,7 @@ extern int atexit (void (*)(void));
 extern int errno;
 #endif
 
-/* GCC (fixproto) guarantees these system headers exist.  */
+/* If these system headers do not exist, fixincludes must create them.  */
 #include <string.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -81,7 +104,7 @@ extern int errno;
 /* GCC supplies this header.  */
 #include <limits.h>
 
-/* GCC (fixproto) guarantees this system headers exists.  */
+/* If these system headers do not exist, fixincludes must create them.  */
 #include <time.h>
 
 #endif /* inhibit_libc */
@@ -91,4 +114,21 @@ extern int errno;
 #define NULL 0
 #endif
 
+/* 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 */