From: Fred Morcos Date: Wed, 16 Aug 2023 09:23:42 +0000 (+0200) Subject: Meson: Cleanup sterror_r module X-Git-Tag: rec-5.1.0-alpha1~80^2~221 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=30ce7dedb06916fa302b06653d907d3f0946785b;p=thirdparty%2Fpdns.git Meson: Cleanup sterror_r module --- diff --git a/meson/strerror/meson.build b/meson/strerror/meson.build index 7b75050d1d..bc47e80b26 100644 --- a/meson/strerror/meson.build +++ b/meson/strerror/meson.build @@ -1,24 +1,11 @@ -# Strerror_r -# Inputs: conf - -prog = ''' -#include -int main () { - char error_string[256]; - char *ptr = strerror_r(-2, error_string, 256); - char c = *strerror_r(-2, error_string, 256); - return c != 0 && ptr != (void*) 0L; -} -''' - have_strerror_r_decl = cxx.has_header_symbol('string.h', 'strerror_r') have_strerror_r = cxx.has_function('strerror_r', prefix: '#include ') strerror_r_returns_charp = have_strerror_r and cxx.compiles(prog, name: 'strerror_r() returns char *') -conf.set10('HAVE_DECL_STRERROR_R', have_strerror_r_decl, description: 'Whether strerror_r is declared') -conf.set10('HAVE_STRERROR_R', have_strerror_r, description: 'Whether strerror_r is available') -conf.set10('STRERROR_R_CHAR_P', strerror_r_returns_charp, description: 'Whether strerror_r returns char *') +conf.set('HAVE_DECL_STRERROR_R', have_strerror_r_decl, description: 'Whether strerror_r is declared') +conf.set('HAVE_STRERROR_R', have_strerror_r, description: 'Whether strerror_r is available') +conf.set('STRERROR_R_CHAR_P', strerror_r_returns_charp, description: 'Whether strerror_r returns char *') -summary('strerror_r decl', have_strerror_r_decl, section: 'System') -summary('strerror_r', have_strerror_r, section: 'System') -summary('strerror_r returns char *', strerror_r_returns_charp, section: 'System') +summary('Symbol', have_strerror_r_decl, bool_yn: true, section: 'Function strerror_r') +summary('Declaration', have_strerror_r, bool_yn: true, section: 'Function strerror_r') +summary('Returns char *', strerror_r_returns_charp, bool_yn: true, section: 'Function strerror_r') diff --git a/meson/strerror/strerror_r.cc b/meson/strerror/strerror_r.cc new file mode 100644 index 0000000000..d6a5dce3f5 --- /dev/null +++ b/meson/strerror/strerror_r.cc @@ -0,0 +1,8 @@ +#include + +int main () { + char error_string[256]; + char *ptr = strerror_r(-2, error_string, 256); + char c = *strerror_r(-2, error_string, 256); + return c != 0 && ptr != (void*) 0L; +}