From 51bf1b81f3c4c7c02d8101f8ab6eb5609892e728 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Fri, 20 Nov 2015 18:03:05 +0100 Subject: Make match function globally available to stdlib functions. * libc/stdlib/strtod.c (match): Move from here... * libc/stdlib/gdtoa-hexnan.c (match): ...to here. * libc/stdlib/mprec.h (match): Declare and add __match define. Signed-off-by: Corinna Vinschen --- newlib/libc/stdlib/gdtoa-hexnan.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'newlib/libc/stdlib/gdtoa-hexnan.c') diff --git a/newlib/libc/stdlib/gdtoa-hexnan.c b/newlib/libc/stdlib/gdtoa-hexnan.c index 463000528..24e3783be 100644 --- a/newlib/libc/stdlib/gdtoa-hexnan.c +++ b/newlib/libc/stdlib/gdtoa-hexnan.c @@ -44,6 +44,24 @@ THIS SOFTWARE. #include "gdtoa.h" #ifdef INFNAN_CHECK +int +_DEFUN (match, (sp, t), + _CONST char **sp _AND + char *t) +{ + int c, d; + _CONST char *s = *sp; + + while( (d = *t++) !=0) { + if ((c = *++s) >= 'A' && c <= 'Z') + c += 'a' - 'A'; + if (c != d) + return 0; + } + *sp = s + 1; + return 1; +} + static void _DEFUN (L_shift, (x, x1, i), __ULong *x _AND -- cgit v1.2.3