]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
add definitions for extension libraries 5374/head
authorAlan T. DeKok <aland@freeradius.org>
Tue, 5 May 2026 20:14:04 +0000 (16:14 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 6 May 2026 00:32:36 +0000 (20:32 -0400)
because we already add our own wrappers, and we want to be sure
that they are compatible with the upstream code.

src/lib/util/libfreeradius-util.mk
src/lib/util/talloc.c
src/lib/util/talloc.h
src/lib/util/test/all.mk

index e3723deddfc4509c7157e05cc8a7e079392be46d..39662d25ba4eabbee924adfdb225f5f4f086d9ee 100644 (file)
@@ -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.
index cecafa57af391478aa6aaabed4e9b5ed94b7aab9..9780726b4675f93cc2f0d270819ec5825ee44210 100644 (file)
@@ -28,6 +28,7 @@ RCSID("$Id$")
 #include <freeradius-devel/util/dlist.h>
 #include <freeradius-devel/util/syserror.h>
 
+#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
index d983e942e0c32a8d1c5a858b1b35055d568b9fc6..b65112d6de797b9f25ae4ed371939c0e5c3fca02 100644 (file)
@@ -34,6 +34,10 @@ extern "C" {
 #include <freeradius-devel/build.h>
 #include <freeradius-devel/missing.h>
 
+#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
 }
index 396c3d641c6058d8427c7bde18e960eef8cb56f4..0d7c7c2c27a8a71f3cb8684b4c51ba953583a870 100644 (file)
@@ -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