From: Alan T. DeKok Date: Tue, 5 May 2026 20:14:04 +0000 (-0400) Subject: add definitions for extension libraries X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=22fbb2d0f8e005ca726ee64e6867d0995aecefa7;p=thirdparty%2Ffreeradius-server.git add definitions for extension libraries because we already add our own wrappers, and we want to be sure that they are compatible with the upstream code. --- diff --git a/src/lib/util/libfreeradius-util.mk b/src/lib/util/libfreeradius-util.mk index e3723deddfc..39662d25ba4 100644 --- a/src/lib/util/libfreeradius-util.mk +++ b/src/lib/util/libfreeradius-util.mk @@ -121,6 +121,8 @@ SRC_CFLAGS := -DNO_ASSERT -DTOP_SRCDIR=\"${top_srcdir}\" -I$(top_builddir)/src TGT_LDLIBS := $(LIBS) $(PCAP_LIBS) TGT_LDFLAGS := $(LDFLAGS) $(PCAP_LDFLAGS) +TGT_PREREQS := $(TALLOC_EXTENSION_LIBS) + # libbacktrace is checked out as a submodule and linked statically into libfreeradius-util # as it's the only library that uses it. Other libraries should not use it directly but # instead add the functionality they need to libfreeradius-util. diff --git a/src/lib/util/talloc.c b/src/lib/util/talloc.c index cecafa57af3..9780726b467 100644 --- a/src/lib/util/talloc.c +++ b/src/lib/util/talloc.c @@ -28,6 +28,7 @@ RCSID("$Id$") #include #include +#ifndef TALLOC_EXTENSIONS static TALLOC_CTX *global_ctx; static _Thread_local TALLOC_CTX *thread_local_ctx; @@ -932,3 +933,4 @@ TALLOC_CTX *talloc_autofree_context_thread_local(void) return af; } +#endif diff --git a/src/lib/util/talloc.h b/src/lib/util/talloc.h index d983e942e0c..b65112d6de7 100644 --- a/src/lib/util/talloc.h +++ b/src/lib/util/talloc.h @@ -34,6 +34,10 @@ extern "C" { #include #include +#ifdef TALLOC_EXTENSIONS +#include TALLOC_EXTENSIONS +#else + /* * The default talloc headers have doxygen complaints. */ @@ -256,6 +260,7 @@ static inline int talloc_const_free(void const *ptr) TALLOC_CTX *talloc_autofree_context_global(void); TALLOC_CTX *talloc_autofree_context_thread_local(void); +#endif #ifdef __cplusplus } diff --git a/src/lib/util/test/all.mk b/src/lib/util/test/all.mk index 396c3d641c6..0d7c7c2c27a 100644 --- a/src/lib/util/test/all.mk +++ b/src/lib/util/test/all.mk @@ -25,8 +25,11 @@ SUBMAKEFILES := \ size_tests.mk \ slab_tests.mk \ strerror_tests.mk \ - talloc_tests.mk \ time_tests.mk \ timer_tests.mk \ trie_tests.mk \ value_tests.mk + +ifeq "$(TALLOC_EXTENSION_LIBS)" "" +SUBMAKEFILES += talloc_tests.mk +endif