From 99b65b5be32158ebc793df4ab2b825633e32a100 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Orsini Date: Thu, 13 Feb 2014 10:41:29 +0000 Subject: [PATCH] fix json_bool --- config.h.in | 3 +++ configure | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ configure.ac | 2 ++ po/Makefile | 2 +- po/Makefile.in | 2 +- po/fr.po | 4 ++-- po/ppastats.pot | 4 ++-- src/lp_json.c | 3 ++- 8 files changed, 76 insertions(+), 7 deletions(-) diff --git a/config.h.in b/config.h.in index 4780543..00b832a 100644 --- a/config.h.in +++ b/config.h.in @@ -28,6 +28,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H +/* Use json_bool */ +#undef HAVE_JSON_BOOL + /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H diff --git a/configure b/configure index c0acd97..d5310d9 100755 --- a/configure +++ b/configure @@ -1793,6 +1793,60 @@ $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile + +# ac_fn_c_check_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_type cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. @@ -6870,6 +6924,15 @@ fi +ac_fn_c_check_type "$LINENO" "json_bool" "ac_cv_type_json_bool" "#include +" +if test "x$ac_cv_type_json_bool" = xyes; then : + +$as_echo "#define HAVE_JSON_BOOL 1" >>confdefs.h + +fi + + ac_config_files="$ac_config_files po/Makefile.in Makefile src/Makefile tests/Makefile www/footer.tpl www/Makefile" diff --git a/configure.ac b/configure.ac index 1e6be59..9af918e 100644 --- a/configure.ac +++ b/configure.ac @@ -34,6 +34,8 @@ PKG_CHECK_MODULES(JSON, json ) AC_SUBST(JSON_CFLAGS) AC_SUBST(JSON_LIBS) +AC_CHECK_TYPE(json_bool, [AC_DEFINE([HAVE_JSON_BOOL], 1, [Use json_bool])], [], [[#include ]]) + AC_CONFIG_FILES([ po/Makefile.in Makefile src/Makefile diff --git a/po/Makefile b/po/Makefile index 7f1eeb9..00efa4a 100644 --- a/po/Makefile +++ b/po/Makefile @@ -22,7 +22,7 @@ srcdir = . top_srcdir = .. -prefix = /tmp +prefix = /usr/local exec_prefix = ${prefix} datarootdir = ${prefix}/share datadir = ${datarootdir} diff --git a/po/Makefile.in b/po/Makefile.in index 0b254fb..66e9f98 100644 --- a/po/Makefile.in +++ b/po/Makefile.in @@ -22,7 +22,7 @@ srcdir = . top_srcdir = .. -prefix = /tmp +prefix = /usr/local exec_prefix = ${prefix} datarootdir = ${prefix}/share datadir = ${datarootdir} diff --git a/po/fr.po b/po/fr.po index 18648a4..61d69a2 100644 --- a/po/fr.po +++ b/po/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ppastats 0.0.x\n" "Report-Msgid-Bugs-To: jeanfi@gmail.com\n" -"POT-Creation-Date: 2013-05-12 20:46+0200\n" +"POT-Creation-Date: 2014-02-13 10:45+0100\n" "PO-Revision-Date: 2012-05-05 23:45+0200\n" "Last-Translator: \n" "Language-Team: French\n" @@ -50,7 +50,7 @@ msgstr "" msgid "Generating %s" msgstr "" -#: src/html.c:581 +#: src/html.c:582 #, c-format msgid "Copying %s %s" msgstr "" diff --git a/po/ppastats.pot b/po/ppastats.pot index ce294f2..0883e6a 100644 --- a/po/ppastats.pot +++ b/po/ppastats.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: ppastats 0.0.x\n" "Report-Msgid-Bugs-To: jeanfi@gmail.com\n" -"POT-Creation-Date: 2013-05-12 20:46+0200\n" +"POT-Creation-Date: 2014-02-13 10:45+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -50,7 +50,7 @@ msgstr "" msgid "Generating %s" msgstr "" -#: src/html.c:581 +#: src/html.c:582 #, c-format msgid "Copying %s %s" msgstr "" diff --git a/src/lp_json.c b/src/lp_json.c index ddb8f31..e02ef62 100644 --- a/src/lp_json.c +++ b/src/lp_json.c @@ -23,12 +23,13 @@ #include #include +#include #include "lp_json.h" #include "lp_ws.h" /* Declares json_bool to have consistent code even with old json lib releases using boolean instead of json_bool.*/ -#ifndef json_bool +#ifndef HAVE_JSON_BOOL typedef boolean json_bool; #endif -- 2.7.4