make cxListMemoryMgmt a linkable symbol

Sat, 16 Apr 2022 20:44:47 +0200

author
Mike Becker <universe@uap-core.de>
date
Sat, 16 Apr 2022 20:44:47 +0200
changeset 519
79d14e821b3a
parent 518
74d0372f5c6f
child 520
f937c6d11d1f

make cxListMemoryMgmt a linkable symbol

src/cx/list.h file | annotate | diff | comparison | revisions
src/list.c file | annotate | diff | comparison | revisions
--- a/src/cx/list.h	Sat Apr 16 20:17:01 2022 +0200
+++ b/src/cx/list.h	Sat Apr 16 20:44:47 2022 +0200
@@ -203,18 +203,13 @@
  * if the content destructor did not do that or no content destructor exists
  */
 __attribute__((__nonnull__(1)))
-static inline void cxListMemoryMgmt(
+void cxListMemoryMgmt(
         CxList *list,
         cx_destructor_func list_destructor,
         cx_destructor_func content_destructor,
         bool list_autofree,
         bool content_autofree
-) {
-    if (list_destructor != NULL) list->list_destructor = list_destructor;
-    list->content_destructor = content_destructor;
-    list->autofree = list_autofree;
-    list->autofree_contents = content_autofree;
-}
+);
 
 /**
  * Adds an item to the end of the list.
--- a/src/list.c	Sat Apr 16 20:17:01 2022 +0200
+++ b/src/list.c	Sat Apr 16 20:44:47 2022 +0200
@@ -57,3 +57,16 @@
         return list->list_destructor(list);
     }
 }
+
+void cxListMemoryMgmt(
+        CxList *list,
+        cx_destructor_func list_destructor,
+        cx_destructor_func content_destructor,
+        bool list_autofree,
+        bool content_autofree
+) {
+    if (list_destructor != NULL) list->list_destructor = list_destructor;
+    list->content_destructor = content_destructor;
+    list->autofree = list_autofree;
+    list->autofree_contents = content_autofree;
+}

mercurial