From 81482506607042ffb006d571f02da9382b6ca33b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Fri, 14 Jan 2022 07:55:37 +0800 Subject: langinfo use is based on header presence --- configure.ac | 2 ++ handler.c | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 7f4be42..f18a8c9 100644 --- a/configure.ac +++ b/configure.ac @@ -6,6 +6,8 @@ LT_INIT PKG_CHECK_MODULES([TIDY], [tidy]) AC_CHECK_HEADERS([threads.h], [AC_DEFINE([HAVE_THREADS_H])]) +AC_CHECK_HEADERS([langinfo.h], + [AC_DEFINE([HAVE_LANGINFO_H])]) AC_CHECK_HEADER_STDBOOL AC_C_INLINE AC_CHECK_FUNCS([memset]) diff --git a/handler.c b/handler.c index a5833b8..eb456c1 100644 --- a/handler.c +++ b/handler.c @@ -1,6 +1,8 @@ #include #include +#ifdef HAVE_LANGINFO_H #include +#endif #include #include #include "icclient.h" @@ -99,7 +101,7 @@ static void recurse(TidyDoc doc, TidyNode tnod, struct icclient_catalog **catalo strcpy(*category, text); } else { is_price = false; -#ifndef __ANDROID__ +#ifdef HAVE_LANGINFO_H char *symbol = nl_langinfo_l(CRNCYSTR, loc); size_t symbol_len = strlen(symbol) - 1; if (symbol[0] == '-') -- cgit v1.2.3