From 30da725e671911fc04d130c81cfdf3043befe8ed Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Tue, 23 Jul 2024 10:02:39 +0200 Subject: [PATCH] - Fix to have empty definition when not supported for weak attribute. --- configure | 4 ++++ configure.ac | 2 ++ doc/Changelog | 1 + 3 files changed, 7 insertions(+) diff --git a/configure b/configure index 6a4066771..daa37e504 100755 --- a/configure +++ b/configure @@ -6976,6 +6976,10 @@ printf "%s\n" "#define HAVE_ATTR_WEAK 1" >>confdefs.h printf "%s\n" "#define ATTR_WEAK __attribute__((weak))" >>confdefs.h +else + +printf "%s\n" "#define ATTR_WEAK /**/" >>confdefs.h + fi diff --git a/configure.ac b/configure.ac index 977b91a24..4d17fb8c1 100644 --- a/configure.ac +++ b/configure.ac @@ -339,6 +339,8 @@ AC_MSG_RESULT($ac_cv_c_weak_attribute) if test $ac_cv_c_weak_attribute = yes; then AC_DEFINE(HAVE_ATTR_WEAK, 1, [Whether the C compiler accepts the "weak" attribute]) AC_DEFINE(ATTR_WEAK, [__attribute__((weak))], [apply the weak attribute to a symbol]) +else + AC_DEFINE(ATTR_WEAK,[], [apply the weak attribute to a symbol]) fi ])dnl End of CHECK_WEAK_ATTRIBUTE diff --git a/doc/Changelog b/doc/Changelog index e9b2e7a40..45099106d 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -7,6 +7,7 @@ fallthrough attribute annotations. - Fix compile when the compiler does not support the noreturn attribute. + - Fix to have empty definition when not supported for weak attribute. 19 July 2024: Wouter - Add dnstap-sample-rate that logs only 1/N messages, for high volume -- 2.47.3