to __strchrnul, and add weak aliases for them.
extern void *memchr (__const void *__s, int __c, size_t __n)
__THROW __attribute_pure__;
-/*#ifdef __USE_GNU*/
-#if 0
+#ifdef __USE_GNU
/* Search in S for C. This is similar to `memchr' but there is no
length limit. */
extern void *rawmemchr (__const void *__s, int __c) __THROW __attribute_pure__;
/* Find the last occurrence of C in S. */
extern char *strrchr (__const char *__s, int __c) __THROW __attribute_pure__;
-#if 0
-/*#ifdef __USE_GNU*/
+#ifdef __USE_GNU
/* This funciton is similar to `strchr'. But it returns a pointer to
the closing NUL byte in case C is not found in S. */
extern char *strchrnul (__const char *__s, int __c) __THROW __attribute_pure__;
#ifdef __LOCALE_C_ONLY
-link_warning(setlocale,"the 'setlocale' function supports only C|POSIX locales");
+link_warning(setlocale,"the 'setlocale' function supports only C|POSIX locales")
static const char C_string[] = "C";
#ifdef __LOCALE_C_ONLY
-#warning localeconv is hardwired for C/POSIX locale only
-link_warning(localeconv,"the 'localeconv' function is hardwired for C/POSIX locale only");
+link_warning(localeconv,"the 'localeconv' function is hardwired for C/POSIX locale only")
static struct lconv the_lconv;
r = CODESET_LIST;
__global_locale.codeset = r + r[c -= 3];
__global_locale.encoding = __ctype_encoding_8_bit;
+#ifdef __UCLIBC_MJN3_ONLY__
#warning REMINDER: update 8 bit mb_cur_max when trasnlit implemented!
+#endif
/* TODO - update when translit implemented! */
__global_locale.mb_cur_max = 1;
c8b = __locale_mmap->codeset_8_bit + c;
#ifdef __UCLIBC_HAS_LOCALE__
#define ENCODING (__global_locale.encoding)
+#ifdef __UCLIBC_MJN3_ONLY__
#warning implement __CTYPE_HAS_UTF_8_LOCALES!
+#endif
#define __CTYPE_HAS_UTF_8_LOCALES
#else
#undef __CTYPE_HAS_8_BIT_LOCALES
--n;
if ((wc = ((unsigned char) *s++)) >= 0x80) { /* Not ASCII... */
mask = 0x40;
+#ifdef __UCLIBC_MJN3_ONLY__
#warning fix range for 16 bit wides
+#endif
if ( ((unsigned char)(s[-1] - 0xc0)) < (0xfe - 0xc0) ) {
goto START;
}
/**********************************************************************/
#ifdef L_iswctype
+#ifdef __UCLIBC_MJN3_ONLY__
#warning duh... replace the range-based classification with table lookup!
+#endif
#ifdef __WCTYPE_WITH_LOCALE
+#ifdef __UCLIBC_MJN3_ONLY__
#warning TODO: need to fix locale ctype table lookup stuff
+#endif
#if 0
extern const char ctype_range[];
#else
};
#endif
+#ifdef __UCLIBC_MJN3_ONLY__
#warning TODO: need to handle combining class!
+#endif
#define WCctype_TI_MASK ((1 << WCctype_TI_SHIFT) - 1)
#define WCctype_II_MASK ((1 << WCctype_II_SHIFT) - 1)
#ifdef __UCLIBC_HAS_LOCALE__
#define ENCODING (__global_locale.encoding)
+#ifdef __UCLIBC_MJN3_ONLY__
#warning implement __CTYPE_HAS_UTF_8_LOCALES!
+#endif
#define __CTYPE_HAS_UTF_8_LOCALES
#else
#define ENCODING (__ctype_encoding_7_bit)
return __global_locale.mb_cur_max;
#else
#ifdef __CTYPE_HAS_8_BIT_LOCALES
+#ifdef __UCLIBC_MJN3_ONLY__
#warning need to change this when/if transliteration is implemented
#endif
+#endif
return 1;
#endif
}
MOBJW2= wcscasecmp.o wcscat.o wcschrnul.o wcschr.o wcscmp.o wcscpy.o wcscspn.o \
wcsdup.o wcslen.o wcsncasecmp.o wcsncat.o wcsncmp.o wcsncpy.o \
wcsnlen.o wcspbrk.o wcsrchr.o wcsspn.o wcsstr.o wcstok.o wmemchr.o \
- wmemcmp.o wmemcpy.o wmemmove.o wmempcpy.o wmemset.o wcpcpy.o wcpncpy.o
+ wmemcmp.o wmemcpy.o wmemmove.o wmempcpy.o wmemset.o wcpcpy.o wcpncpy.o \
+ wcschrnul.o
# wcscoll wcsxfrm
#endif
#if EWOULDBLOCK != EAGAIN
-#warning EWOULDBLOCK does not equal EAGAIN
+#error EWOULDBLOCK does not equal EAGAIN
#endif
/* For now, ignore the other arch-specific errors. glibc only maps EPROCLIM. */
#ifdef L_strcmp
#ifndef L_wcscmp
+#ifdef __UCLIBC_MJN3_ONLY__
#warning implement strcoll and remove weak alias (or enable for C locale only)
+#endif
weak_alias(strcmp,strcoll);
#endif
/**********************************************************************/
#ifdef L_wcschrnul
#define L_strchrnul
+#define __Wstrchrnul __wcschrnul
#define Wstrchrnul wcschrnul
#else
+#define __Wstrchrnul __strchrnul
#define Wstrchrnul strchrnul
#endif
#ifdef L_strchrnul
-Wchar *Wstrchrnul(register const Wchar *s, Wint c)
+extern Wchar *__Wstrchrnul(register const Wchar *s, Wint c);
+weak_alias(__Wstrchrnul, Wstrchrnul);
+
+Wchar *__Wstrchrnul(register const Wchar *s, Wint c)
{
--s;
while (*++s && (*s != ((Wchar)c)));