diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2012-05-03 13:04:14 +0200 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2012-05-03 13:04:14 +0200 |
commit | 455cd6cadefb6f287fb423773ce397dd265cc5bc (patch) | |
tree | 91c8c80519eb52c16378095be2f5ec0ca81c6fc2 | |
parent | 8e96c897b6d167980f1f3d6fc03a54dbff0bcf21 (diff) |
rpmatch: provide out-of-line implementation
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-rw-r--r-- | include/stdlib.h | 7 | ||||
-rw-r--r-- | libc/stdlib/Makefile.in | 2 | ||||
-rw-r--r-- | libc/stdlib/rpmatch.c | 7 | ||||
-rw-r--r-- | libc/stdlib/stdlib.c | 8 |
4 files changed, 17 insertions, 7 deletions
diff --git a/include/stdlib.h b/include/stdlib.h index 8ea6541f0..fdefe4aa4 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -833,12 +833,7 @@ __END_NAMESPACE_STD or negative response expression as specified by the LC_MESSAGES category in the program's current locale. Returns 1 if affirmative, 0 if negative, and -1 if not matching. */ -/* __THROW */ -static __inline __nonnull ((1)) __wur int rpmatch (__const char *__response) -{ - return (__response[0] == 'y' || __response[0] == 'Y') ? 1 : - (__response[0] == 'n' || __response[0] == 'N') ? 0 : -1; -} +extern int rpmatch (__const char *__response) __THROW __nonnull ((1)) __wur; #endif diff --git a/libc/stdlib/Makefile.in b/libc/stdlib/Makefile.in index d9278072b..2983d4787 100644 --- a/libc/stdlib/Makefile.in +++ b/libc/stdlib/Makefile.in @@ -33,7 +33,7 @@ endif # multi source stdlib.c CSRC-y += abs.c labs.c atoi.c atol.c strtol.c strtoul.c _stdlib_strto_l.c \ - qsort.c qsort_r.c bsearch.c \ + qsort.c qsort_r.c bsearch.c rpmatch.c \ llabs.c atoll.c strtoll.c strtoull.c _stdlib_strto_ll.c # (aliases) strtoq.o strtouq.o CSRC-$(UCLIBC_HAS_FLOATS) += atof.c diff --git a/libc/stdlib/rpmatch.c b/libc/stdlib/rpmatch.c new file mode 100644 index 000000000..dce06b641 --- /dev/null +++ b/libc/stdlib/rpmatch.c @@ -0,0 +1,7 @@ +/* Copyright (C) 2012 Bernhard Reutner-Fischer <uclibc@uclibc.org> + * + * Licensed under the LGPL v2.1+, see the file COPYING.LIB in this tarball. + */ + +#define L_rpmatch +#include "stdlib.c" diff --git a/libc/stdlib/stdlib.c b/libc/stdlib/stdlib.c index 9e8c347fd..de8f084bd 100644 --- a/libc/stdlib/stdlib.c +++ b/libc/stdlib/stdlib.c @@ -318,6 +318,14 @@ long long atoll(const char *nptr) #endif /**********************************************************************/ +#ifdef L_rpmatch +int rpmatch (__const char *__response) +{ + return (__response[0] == 'y' || __response[0] == 'Y') ? 1 : + (__response[0] == 'n' || __response[0] == 'N') ? 0 : -1; +} +#endif +/**********************************************************************/ #if defined(L_strtol) || defined(L_strtol_l) libc_hidden_proto(__XL_NPP(strtol)) |