0
0
mirror of https://github.com/rkd77/elinks.git synced 2025-06-30 22:19:29 -04:00

[meson] Detect if gettext has _nl_msg_cat_cntr . Refs #325

This commit is contained in:
Witold Filipczyk 2024-09-11 09:34:16 +02:00
parent fa2d778c8d
commit 0f46877572
4 changed files with 19 additions and 4 deletions

View File

@ -545,6 +545,9 @@
/* Define to 1 if you have the <net/if.h> header file. */ /* Define to 1 if you have the <net/if.h> header file. */
#mesondefine HAVE_NET_IF_H #mesondefine HAVE_NET_IF_H
/* Define to 1 if gettext has _nl_msg_cat_cntr */
#mesondefine HAVE_NL_MSG_CAT_CNTR
/* Define if you have off_t */ /* Define if you have off_t */
#mesondefine HAVE_OFF_T #mesondefine HAVE_OFF_T

View File

@ -1117,6 +1117,16 @@ if compiler.compiles('int a; typeof(a) b;', name: 'typeof')
conf_data.set('HAVE_TYPEOF', 1) conf_data.set('HAVE_TYPEOF', 1)
endif endif
if conf_data.get('CONFIG_GETTEXT') and conf_data.get('CONFIG_NLS')
code = '''#include <libintl.h>
extern int _nl_msg_cat_cntr;
void main() { _nl_msg_cat_cntr = 1; }
'''
if compiler.links(code, name: 'test')
conf_data.set('HAVE_NL_MSG_CAT_CNTR', 1)
endif
endif
if compiler.compiles('''#include <unistd.h> if compiler.compiles('''#include <unistd.h>
int func(void) { return sysconf(_SC_PAGE_SIZE); } int func(void) { return sysconf(_SC_PAGE_SIZE); }
''', name: '_SC_PAGE_SIZE') ''', name: '_SC_PAGE_SIZE')

View File

@ -217,8 +217,12 @@ set_language(int language)
} }
} }
env_set("LANGUAGE", LANGUAGE, -1); env_set("LANGUAGE", LANGUAGE, -1);
{
_nl_msg_cat_cntr++; #ifdef HAVE_NL_MSG_CAT_CNTR
extern int _nl_msg_cat_cntr;
_nl_msg_cat_cntr++;
#endif
}
} }
static void static void

View File

@ -13,8 +13,6 @@ extern "C" {
extern struct module gettext_module; extern struct module gettext_module;
#ifdef CONFIG_GETTEXT #ifdef CONFIG_GETTEXT
extern int _nl_msg_cat_cntr;
#include <libintl.h> #include <libintl.h>
extern int current_charset; extern int current_charset;