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
     1.1 --- a/src/cx/list.h	Sat Apr 16 20:17:01 2022 +0200
     1.2 +++ b/src/cx/list.h	Sat Apr 16 20:44:47 2022 +0200
     1.3 @@ -203,18 +203,13 @@
     1.4   * if the content destructor did not do that or no content destructor exists
     1.5   */
     1.6  __attribute__((__nonnull__(1)))
     1.7 -static inline void cxListMemoryMgmt(
     1.8 +void cxListMemoryMgmt(
     1.9          CxList *list,
    1.10          cx_destructor_func list_destructor,
    1.11          cx_destructor_func content_destructor,
    1.12          bool list_autofree,
    1.13          bool content_autofree
    1.14 -) {
    1.15 -    if (list_destructor != NULL) list->list_destructor = list_destructor;
    1.16 -    list->content_destructor = content_destructor;
    1.17 -    list->autofree = list_autofree;
    1.18 -    list->autofree_contents = content_autofree;
    1.19 -}
    1.20 +);
    1.21  
    1.22  /**
    1.23   * Adds an item to the end of the list.
     2.1 --- a/src/list.c	Sat Apr 16 20:17:01 2022 +0200
     2.2 +++ b/src/list.c	Sat Apr 16 20:44:47 2022 +0200
     2.3 @@ -57,3 +57,16 @@
     2.4          return list->list_destructor(list);
     2.5      }
     2.6  }
     2.7 +
     2.8 +void cxListMemoryMgmt(
     2.9 +        CxList *list,
    2.10 +        cx_destructor_func list_destructor,
    2.11 +        cx_destructor_func content_destructor,
    2.12 +        bool list_autofree,
    2.13 +        bool content_autofree
    2.14 +) {
    2.15 +    if (list_destructor != NULL) list->list_destructor = list_destructor;
    2.16 +    list->content_destructor = content_destructor;
    2.17 +    list->autofree = list_autofree;
    2.18 +    list->autofree_contents = content_autofree;
    2.19 +}

mercurial