diff options
author | merrill <merrill@138bc75d-0d04-0410-961f-82ee72b054a4> | 1995-02-13 22:08:25 +0000 |
---|---|---|
committer | merrill <merrill@138bc75d-0d04-0410-961f-82ee72b054a4> | 1995-02-13 22:08:25 +0000 |
commit | 560e7d641e10b41391d7d9bbc6edb124df997cd9 (patch) | |
tree | 39a87a7060bcc2140853d1091a9f190799f9b658 /gcc | |
parent | 329edf37866f191bb42ab9d696432d523e942510 (diff) | |
download | ppe42-gcc-560e7d641e10b41391d7d9bbc6edb124df997cd9.tar.gz ppe42-gcc-560e7d641e10b41391d7d9bbc6edb124df997cd9.zip |
Don't call write ifdef inhibit_libc.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@8941 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/libgcc2.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/libgcc2.c b/gcc/libgcc2.c index 68f03cebf91..e5a1e09ed57 100644 --- a/gcc/libgcc2.c +++ b/gcc/libgcc2.c @@ -1671,10 +1671,12 @@ set_new_handler (vfp handler) void __default_new_handler () { +#ifndef inhibit_libc /* don't use fprintf (stderr, ...) because it may need to call malloc. */ /* This should really print the name of the program, but that is hard to do. We need a standard, clean way to get at the name. */ write (2, MESSAGE, sizeof (MESSAGE)); +#endif /* don't call exit () because that may call global destructors which may cause a loop. */ _exit (-1); @@ -2276,11 +2278,26 @@ __unwind_function(void *ptr) #endif /* L_eh */ #ifdef L_pure +#ifndef inhibit_libc +/* This gets us __GNU_LIBRARY__. */ +#undef NULL /* Avoid errors if stdio.h and our stddef.h mismatch. */ +#include <stdio.h> + +#ifdef __GNU_LIBRARY__ + /* Avoid forcing the library's meaning of `write' on the user program + by using the "internal" name (for use within the library) */ +#define write(fd, buf, n) __write((fd), (buf), (n)) +#endif +#endif /* inhibit_libc */ + #define MESSAGE "pure virtual method called\n" + void __pure_virtual () { +#ifndef inhibit_libc write (2, MESSAGE, sizeof (MESSAGE) - 1); +#endif _exit (-1); } #endif |