summaryrefslogtreecommitdiffstats
path: root/libc/misc/gnu/obstack.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/misc/gnu/obstack.c')
-rw-r--r--libc/misc/gnu/obstack.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/libc/misc/gnu/obstack.c b/libc/misc/gnu/obstack.c
index 6521bd1d4..99311183f 100644
--- a/libc/misc/gnu/obstack.c
+++ b/libc/misc/gnu/obstack.c
@@ -51,7 +51,7 @@
# endif
#endif
-#if defined _LIBC && defined USE_IN_LIBIO
+#if (defined _LIBC && defined USE_IN_LIBIO) || defined __UCLIBC_HAS_WCHAR__
# include <wchar.h>
#endif
@@ -89,6 +89,7 @@ union fooround {long x; double d;};
abort gracefully or use longjump - but shouldn't return. This
variable by default points to the internal function
`print_and_abort'. */
+libc_hidden_proto(obstack_alloc_failed_handler)
# if defined __STDC__ && __STDC__
static void print_and_abort (void);
void (*obstack_alloc_failed_handler) (void) = print_and_abort;
@@ -96,6 +97,7 @@ void (*obstack_alloc_failed_handler) (void) = print_and_abort;
static void print_and_abort ();
void (*obstack_alloc_failed_handler) () = print_and_abort;
# endif
+libc_hidden_data_def(obstack_alloc_failed_handler)
/* Exit value used when `print_and_abort' is used. */
@@ -105,7 +107,18 @@ void (*obstack_alloc_failed_handler) () = print_and_abort;
# ifndef EXIT_FAILURE
# define EXIT_FAILURE 1
# endif
+
+libc_hidden_proto(fprintf)
+libc_hidden_proto(abort)
+libc_hidden_proto(exit)
+libc_hidden_proto(stderr)
+#ifdef __UCLIBC_HAS_WCHAR__
+libc_hidden_proto(fwprintf)
+#endif
+
+libc_hidden_proto(obstack_exit_failure)
int obstack_exit_failure = EXIT_FAILURE;
+libc_hidden_data_def(obstack_exit_failure)
/* The non-GNU-C macros copy the obstack into this global variable
to avoid multiple evaluation. */
@@ -480,15 +493,8 @@ _obstack_memory_used (h)
# define fputs(s, f) _IO_fputs (s, f)
# endif
-# ifndef __attribute__
-/* This feature is available in gcc versions 2.5 and later. */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
-# define __attribute__(Spec) /* empty */
-# endif
-# endif
-
static void
-__attribute__ ((noreturn))
+attribute_noreturn
print_and_abort ()
{
/* Don't change any of these strings. Yes, it would be possible to add
@@ -498,11 +504,11 @@ print_and_abort ()
a very similar string which requires a separate translation. */
# if defined _LIBC && defined USE_IN_LIBIO
if (_IO_fwide (stderr, 0) > 0)
- __fwprintf (stderr, L"%s\n", _("memory exhausted"));
+ fwprintf (stderr, L"%s\n", _("memory exhausted"));
else
# endif
fprintf (stderr, "%s\n", _("memory exhausted"));
- __exit (obstack_exit_failure);
+ exit (obstack_exit_failure);
}
# if 0