libjson-c: update to 0.13.1
[openwrt/staging/blogic.git] / package / libs / libjson-c / patches / 000-libm.patch
1 --- a/configure.ac
2 +++ b/configure.ac
3 @@ -76,12 +76,6 @@ AC_FUNC_VPRINTF
4 AC_FUNC_MEMCMP
5 AC_CHECK_FUNCS([realloc])
6 AC_CHECK_FUNCS(strcasecmp strdup strerror snprintf vsnprintf vasprintf open vsyslog strncasecmp setlocale)
7 -AC_CHECK_DECLS([INFINITY], [], [], [[#include <math.h>]])
8 -AC_CHECK_DECLS([nan], [], [], [[#include <math.h>]])
9 -AC_CHECK_DECLS([isnan], [], [], [[#include <math.h>]])
10 -AC_CHECK_DECLS([isinf], [], [], [[#include <math.h>]])
11 -AC_CHECK_DECLS([_isnan], [], [], [[#include <float.h>]])
12 -AC_CHECK_DECLS([_finite], [], [], [[#include <float.h>]])
13 AC_MSG_CHECKING(for GCC atomic builtins)
14 AC_LINK_IFELSE(
15 [
16 --- a/math_compat.h
17 +++ b/math_compat.h
18 @@ -6,31 +6,9 @@
19 * @brief Do not use, json-c internal, may be changed or removed at any time.
20 */
21
22 -/* Define isnan, isinf, infinity and nan on Windows/MSVC */
23 -
24 -#ifndef HAVE_DECL_ISNAN
25 -# ifdef HAVE_DECL__ISNAN
26 -#include <float.h>
27 -#define isnan(x) _isnan(x)
28 -# endif
29 -#endif
30 -
31 -#ifndef HAVE_DECL_ISINF
32 -# ifdef HAVE_DECL__FINITE
33 -#include <float.h>
34 -#define isinf(x) (!_finite(x))
35 -# endif
36 -#endif
37 -
38 -#ifndef HAVE_DECL_INFINITY
39 -#include <float.h>
40 -#define INFINITY (DBL_MAX + DBL_MAX)
41 -#define HAVE_DECL_INFINITY
42 -#endif
43 -
44 -#ifndef HAVE_DECL_NAN
45 -#define NAN (INFINITY - INFINITY)
46 -#define HAVE_DECL_NAN
47 -#endif
48 +#undef isnan
49 +#define isnan(x) __builtin_isnan(x)
50 +#undef isinf
51 +#define isinf(x) __builtin_isinf(x)
52
53 #endif