From: Jo-Philipp Wich Date: Sun, 10 Jul 2011 23:39:33 +0000 (+0000) Subject: tokyocabinet: add missing function nanl() to work with backfire/uClibc 0.9.30 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=3d31140cc18ef587ecdad28411a5410c1cfc33be;p=openwrt%2Fsvn-archive%2Fpackages.git tokyocabinet: add missing function nanl() to work with backfire/uClibc 0.9.30 SVN-Revision: 27584 --- diff --git a/libs/tokyocabinet/patches/200-uclibc_0.9.30_compat.patch b/libs/tokyocabinet/patches/200-uclibc_0.9.30_compat.patch new file mode 100644 index 000000000..bf6a4346c --- /dev/null +++ b/libs/tokyocabinet/patches/200-uclibc_0.9.30_compat.patch @@ -0,0 +1,29 @@ +--- a/tctdb.c ++++ b/tctdb.c +@@ -20,6 +20,26 @@ + #include "tctdb.h" + #include "myconf.h" + ++#ifdef __UCLIBC__ ++# include ++# if __UCLIBC_MINOR__ <= 9 && __UCLIBC_SUBLEVEL__ <= 30 ++ ++size_t strlen(const char *s); ++long double strtold(const char *nptr, char **endptr); ++static inline long double nanl(const char *tagp) ++{ ++ if (tagp[0] != '\0') { ++ char buf[6 + strlen(tagp)]; ++ sprintf(buf, "NAN(%s)", tagp); ++ return strtold(buf, NULL); ++ } ++ return NAN; ++} ++ ++# endif /* __UCLIBC_MINOR__ <= 9 && __UCLIBC_SUBLEVEL__ <= 30 */ ++#endif /* __UCLIBC__ */ ++ ++ + #define TDBOPAQUESIZ 64 // size of using opaque field + #define TDBLEFTOPQSIZ 64 // size of left opaque field + #define TDBPAGEBUFSIZ 32768 // size of a buffer to read each page