source: packages/libs/tokyocabinet/patches/200-uclibc_0.9.30_compat.patch @ 27584

Last change on this file since 27584 was 27584, checked in by jow, 5 years ago

[packages] tokyocabinet: add missing function nanl() to work with backfire/uClibc 0.9.30

File size: 855 bytes
  • tctdb.c

    a b  
    2020#include "tctdb.h" 
    2121#include "myconf.h" 
    2222 
     23#ifdef __UCLIBC__ 
     24# include <features.h> 
     25# if __UCLIBC_MINOR__ <= 9 && __UCLIBC_SUBLEVEL__ <= 30 
     26 
     27size_t strlen(const char *s); 
     28long double strtold(const char *nptr, char **endptr); 
     29static inline long double nanl(const char *tagp) 
     30{ 
     31        if (tagp[0] != '\0') { 
     32                char buf[6 + strlen(tagp)]; 
     33                sprintf(buf, "NAN(%s)", tagp); 
     34                return strtold(buf, NULL); 
     35        } 
     36        return NAN; 
     37} 
     38 
     39# endif /* __UCLIBC_MINOR__ <= 9 && __UCLIBC_SUBLEVEL__ <= 30 */ 
     40#endif /* __UCLIBC__ */ 
     41 
     42 
    2343#define TDBOPAQUESIZ   64                // size of using opaque field 
    2444#define TDBLEFTOPQSIZ  64                // size of left opaque field 
    2545#define TDBPAGEBUFSIZ  32768             // size of a buffer to read each page 
Note: See TracBrowser for help on using the repository browser.