system.h (malloc, [...]): Only poison these tokens when IN_GCC is defined.
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>
Tue, 13 Mar 2001 19:55:18 +0000 (19:55 +0000)
committerKaveh Ghazi <ghazi@gcc.gnu.org>
Tue, 13 Mar 2001 19:55:18 +0000 (19:55 +0000)
* system.h (malloc, realloc, calloc, strdup): Only poison these
tokens when IN_GCC is defined.

From-SVN: r40443

gcc/ChangeLog
gcc/system.h

index ef79224cd7952559abc2cb3fb23e9ca296611060..85ca7117c8c7c0454de467216c9fbce65d535d99 100644 (file)
@@ -1,3 +1,8 @@
+2001-03-13  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+       * system.h (malloc, realloc, calloc, strdup): Only poison these
+       tokens when IN_GCC is defined.
+
 Tue Mar 13 14:38:44 CET 2001  Jan Hubicka  <jh@suse.cz>
 
        * i386.md (abs?f expander): Support SSE case.
index a18e34c9d530c9b44b99bb3ce70c71a7d3f29d32..24abf91d75f0cb504156845688e2e6f282255dd7 100644 (file)
@@ -584,11 +584,17 @@ typedef char _Bool;
 
 #if (GCC_VERSION >= 3000)
 
+/* Note autoconf checks for prototype declarations and includes
+   system.h while doing so.  Only poison these tokens if actually
+   compiling gcc, so that the autoconf declaration tests for malloc
+   etc don't spuriously fail.  */
+#ifdef IN_GCC
 #undef malloc
 #undef realloc
 #undef calloc
 #undef strdup
  #pragma GCC poison malloc realloc calloc strdup
+#endif /* IN_GCC */
 
 /* Note: not all uses of `bcopy' and `index' (esp. variable names)
    have been eliminated.  */