Browse Source

rpmatch: provide out-of-line implementation

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Reutner-Fischer 12 years ago
parent
commit
455cd6cade
4 changed files with 17 additions and 7 deletions
  1. 1 6
      include/stdlib.h
  2. 1 1
      libc/stdlib/Makefile.in
  3. 7 0
      libc/stdlib/rpmatch.c
  4. 8 0
      libc/stdlib/stdlib.c

+ 1 - 6
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
 
 

+ 1 - 1
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

+ 7 - 0
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"

+ 8 - 0
libc/stdlib/stdlib.c

@@ -316,6 +316,14 @@ long long atoll(const char *nptr)
 
 #endif /* defined(ULLONG_MAX) && (LLONG_MAX > LONG_MAX) */
 
+#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)