diff options
Diffstat (limited to 'libc/misc/gnu')
-rw-r--r-- | libc/misc/gnu/Makefile.in | 19 | ||||
-rw-r--r-- | libc/misc/gnu/obstack.c | 28 |
2 files changed, 25 insertions, 22 deletions
diff --git a/libc/misc/gnu/Makefile.in b/libc/misc/gnu/Makefile.in index d3ba2e549..bcd9400c3 100644 --- a/libc/misc/gnu/Makefile.in +++ b/libc/misc/gnu/Makefile.in @@ -1,25 +1,22 @@ # Makefile for uClibc # # Copyright (C) 2000 by Lineo, inc. -# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org> +# Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> # # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -CSRC:=obstack.c +CSRC := obstack.c -MISC_GNU_DIR:=$(top_srcdir)libc/misc/gnu -MISC_GNU_OUT:=$(top_builddir)libc/misc/gnu +MISC_GNU_DIR := $(top_srcdir)libc/misc/gnu +MISC_GNU_OUT := $(top_builddir)libc/misc/gnu -MISC_GNU_SRC:=$(MISC_GNU_DIR)/obstack.c -MISC_GNU_OBJ:=$(MISC_GNU_OUT)/obstack.o +MISC_GNU_SRC := $(MISC_GNU_DIR)/obstack.c +MISC_GNU_OBJ := $(MISC_GNU_OUT)/obstack.o -libc-a-y+=$(MISC_GNU_OBJ) -libc-so-y+=$(MISC_GNU_OBJ:.o=.os) +libc-y += $(MISC_GNU_OBJ) -libc-multi-y+=$(MISC_GNU_SRC) - -objclean-y+=misc_gnu_objclean +objclean-y += misc_gnu_objclean misc_gnu_objclean: $(RM) $(MISC_GNU_OUT)/*.{o,os} 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 |