diff options
author | Manuel Novoa III <mjn3@codepoet.org> | 2004-02-11 23:48:50 +0000 |
---|---|---|
committer | Manuel Novoa III <mjn3@codepoet.org> | 2004-02-11 23:48:50 +0000 |
commit | 082e680bd54e999f2bb4eb77141958938b1e9ee9 (patch) | |
tree | 203c45b85ca608e1550d8ffc459456fc9cf0b30b /libc | |
parent | 17c21765b4a97c6f0b74ba8466073e5a3f97cdee (diff) |
New stdio core. Should be more maintainable. Fixes a couple of bugs.
Codepaths streamlined. Improved performance for nonthreaded apps
when linked with a thread-enabled libc.
Minor iconv bug and some locale/thread related startup issues fixed.
These showed up in getting a gcj-compiled java helloworld app running.
Removed some old extension functions... _stdio_fdout and _stdio_fsfopen.
Diffstat (limited to 'libc')
115 files changed, 9161 insertions, 7713 deletions
diff --git a/libc/inet/addr.c b/libc/inet/addr.c index a75916e69..75ebc191e 100644 --- a/libc/inet/addr.c +++ b/libc/inet/addr.c @@ -16,13 +16,14 @@ * Changed to use _int10tostr. */ +#define _GNU_SOURCE #define __FORCE_GLIBC #include <features.h> -#define _STDIO_UTILITY /* For _int10tostr. */ #include <stdio.h> #include <string.h> #include <ctype.h> #include <netinet/in.h> +#include <bits/uClibc_uintmaxtostr.h> int inet_aton(const char *cp, struct in_addr *addrptr); diff --git a/libc/misc/assert/__assert.c b/libc/misc/assert/__assert.c index 74b5ee86f..2949b75f0 100644 --- a/libc/misc/assert/__assert.c +++ b/libc/misc/assert/__assert.c @@ -27,10 +27,11 @@ * and is useful in debugging the stdio code. */ -#define _STDIO_UTILITY /* For _stdio_fdout and _int10tostr. */ +#define _ISOC99_SOURCE #include <stdio.h> #include <stdlib.h> #include <unistd.h> +#include <bits/uClibc_uintmaxtostr.h> /* Get the prototype from assert.h as a double-check. */ #undef NDEBUG @@ -44,8 +45,6 @@ extern const char *__progname; #endif -#if 1 - static int in_assert; /* bss inits to 0. */ void __assert(const char *assertion, const char * filename, @@ -69,31 +68,3 @@ void __assert(const char *assertion, const char * filename, } abort(); } - -#else - -void __assert(const char *assertion, const char * filename, - int linenumber, register const char * function) -{ - char buf[__BUFLEN_INT10TOSTR]; - - _stdio_fdout(STDERR_FILENO, -#ifdef ASSERT_SHOW_PROGNAME - __progname, - ": ", -#endif - filename, - ":", - _int10tostr(buf+sizeof(buf)-1, linenumber), - ": ", - /* Function name isn't available with some compilers. */ - ((function == NULL) ? "?function?" : function), - ": Assertion `", - assertion, - "' failed.\n", - NULL - ); - abort(); -} - -#endif diff --git a/libc/misc/locale/locale.c b/libc/misc/locale/locale.c index cf058ce3e..c6a1a2dd0 100644 --- a/libc/misc/locale/locale.c +++ b/libc/misc/locale/locale.c @@ -346,7 +346,7 @@ struct lconv *localeconv(void) /**********************************************************************/ #if defined(L__locale_init) && !defined(__LOCALE_C_ONLY) -static __uclibc_locale_t __global_locale_data; +__uclibc_locale_t __global_locale_data; __locale_t __global_locale = &__global_locale_data; @@ -1420,7 +1420,7 @@ int __locale_mbrtowc_l(wchar_t *__restrict dst, mbstate_t ps; const char *p = src; size_t r; - ps.mask = 0; + ps.__mask = 0; r = _wchar_utf8sntowcs(dst, 1, &p, SIZE_MAX, &ps, 1); return (r == 1) ? (p-src) : r; /* Need to return 0 if nul char. */ } diff --git a/libc/misc/time/time.c b/libc/misc/time/time.c index e2f1f6c6d..8176e071a 100644 --- a/libc/misc/time/time.c +++ b/libc/misc/time/time.c @@ -135,7 +135,6 @@ */ #define _GNU_SOURCE -#define _STDIO_UTILITY #include <stdio.h> #include <stdlib.h> #include <stddef.h> @@ -147,6 +146,7 @@ #include <ctype.h> #include <langinfo.h> #include <locale.h> +#include <bits/uClibc_uintmaxtostr.h> #ifdef __UCLIBC_HAS_XLOCALE__ #include <xlocale.h> diff --git a/libc/misc/wchar/Makefile b/libc/misc/wchar/Makefile index a96dae2b4..b1db37293 100644 --- a/libc/misc/wchar/Makefile +++ b/libc/misc/wchar/Makefile @@ -33,17 +33,17 @@ ifeq ($(UCLIBC_HAS_LOCALE),y) MOBJ1 += iconv.o endif -MSRC2= wstdio.c -MOBJ2= fwide.o \ - fgetwc.o getwchar.o fgetws.o \ - fputwc.o putwchar.o fputws.o \ - ungetwc.o -# getwc (fgetwc alias) getwc_unlocked (fgetwc_unlocked alias) -# putwc (fputwc alias) putwc_unlocked (fputwc_unlocked alias) - +# The stdio and time related wide functions are now built in the normal +# directories. +# +# stdio: +# fwide fgetwc getwchar fgetws fputwc putwchar fputws ungetwc +# getwc (fgetwc alias) getwc_unlocked (fgetwc_unlocked alias) +# putwc (fputwc alias) putwc_unlocked (fputwc_unlocked alias) +# time: # wcsftime -OBJS=$(MOBJ1) $(MOBJ2) +OBJS=$(MOBJ1) all: $(OBJS) $(LIBC) diff --git a/libc/misc/wchar/wchar.c b/libc/misc/wchar/wchar.c index 4fc96f430..d1383c99f 100644 --- a/libc/misc/wchar/wchar.c +++ b/libc/misc/wchar/wchar.c @@ -1,5 +1,5 @@ -/* Copyright (C) 2002 Manuel Novoa III +/* Copyright (C) 2002, 2003, 2004 Manuel Novoa III * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -92,6 +92,9 @@ * Aug 18, 2003 * Bug fix: _wchar_utf8sntowcs and _wchar_wcsntoutf8s now set errno if EILSEQ. |