From: Aaron Merey Date: Mon, 15 Jun 2026 23:58:55 +0000 (-0400) Subject: version.h: Add _ELFUTILS_THREAD_SAFE X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=edc620b12549cf21466ce8f65ebf049d6f29278f;p=thirdparty%2Felfutils.git version.h: Add _ELFUTILS_THREAD_SAFE Currently there is no API for applications to detect whether elfutils libraries are built with thread safety support enabled (via the --enable-thread-safety configure option). Add macro _ELFUTILS_THREAD_SAFE to version.h. This macro is set to 1 if thread safety support is enabled. If thread safety support is not enabled then this macro is left undefined. Signed-off-by: Aaron Merey --- diff --git a/NEWS b/NEWS index 1e01e327..d811dbe3 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,9 @@ +Version 0.196 + +version.h: New macro _ELFUTILS_THREAD_SAFE added to . + Defined to 1 when the elfutils libraries are built with thread + safety support enabled. Otherwise it is left undefined. + Version 0.195 "Handwritten" CONTRIBUTING: elfutils has adopted a policy on the use of Large Language diff --git a/config/version.h.in b/config/version.h.in index 34e62c3b..6bf3b077 100644 --- a/config/version.h.in +++ b/config/version.h.in @@ -32,6 +32,11 @@ #define _ELFUTILS_VERSION @eu_version@ +/* _ELFUTILS_THREAD_SAFE is defined to 1 when the elfutils libraries + are built with thread safety support enabled. Otherwise it is left + undefined. */ +@eu_thread_safe@ + #define _ELFUTILS_PREREQ(major, minor) \ (_ELFUTILS_VERSION >= ((major) * 1000 + (minor))) diff --git a/configure.ac b/configure.ac index fbe039d5..9bf50d87 100644 --- a/configure.ac +++ b/configure.ac @@ -82,6 +82,11 @@ AS_IF([test "$use_locks" = yes], AH_TEMPLATE([USE_LOCKS], [Defined if libraries should be thread-safe.]) +AS_IF([test "$use_locks" = yes], + [eu_thread_safe="#define _ELFUTILS_THREAD_SAFE 1"], + [eu_thread_safe="/* _ELFUTILS_THREAD_SAFE is not defined. */"]) +AC_SUBST([eu_thread_safe]) + # Provided by gnulib's m4/std-gnu11.m4 for autoconf pre 2.70 AC_PROG_CC AS_IF([test "x$ac_cv_prog_cc_c11" = "xno"],