]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Meson: Cleanup sterror_r module
authorFred Morcos <fred.morcos@open-xchange.com>
Wed, 16 Aug 2023 09:23:42 +0000 (11:23 +0200)
committerFred Morcos <fred.morcos@open-xchange.com>
Wed, 20 Mar 2024 12:28:40 +0000 (13:28 +0100)
meson/strerror/meson.build
meson/strerror/strerror_r.cc [new file with mode: 0644]

index 7b75050d1deb606cab33a15f80c29b47be84f186..bc47e80b26072a3ac75f496ea36547c5359ed8c8 100644 (file)
@@ -1,24 +1,11 @@
-# Strerror_r
-# Inputs: conf
-
-prog = '''
-#include <string.h>
-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 <string.h>')
 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 (file)
index 0000000..d6a5dce
--- /dev/null
@@ -0,0 +1,8 @@
+#include <string.h>
+
+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;
+}