Sun, 26 Sep 2021 11:57:27 +0200
fix missing extern "C"
src/cx/allocator.h | file | annotate | diff | comparison | revisions | |
src/cx/linked_list.h | file | annotate | diff | comparison | revisions | |
src/cx/list.h | file | annotate | diff | comparison | revisions |
1.1 --- a/src/cx/allocator.h Mon Mar 01 22:19:06 2021 +0100 1.2 +++ b/src/cx/allocator.h Sun Sep 26 11:57:27 2021 +0200 1.3 @@ -31,6 +31,10 @@ 1.4 1.5 #include <stdlib.h> 1.6 1.7 +#ifdef __cplusplus 1.8 +extern "C" { 1.9 +#endif 1.10 + 1.11 typedef struct { 1.12 void *(*malloc)(void *data, size_t n); 1.13 void *(*realloc)(void *data, void *mem, size_t n); 1.14 @@ -58,4 +62,8 @@ 1.15 1.16 void cxFree(CxAllocator allocator, void *mem); 1.17 1.18 +#ifdef __cplusplus 1.19 +} /* extern "C" */ 1.20 +#endif 1.21 + 1.22 #endif /* UCX_ALLOCATOR_H */
2.1 --- a/src/cx/linked_list.h Mon Mar 01 22:19:06 2021 +0100 2.2 +++ b/src/cx/linked_list.h Sun Sep 26 11:57:27 2021 +0200 2.3 @@ -32,6 +32,10 @@ 2.4 #include <stddef.h> 2.5 #include "list.h" 2.6 2.7 +#ifdef __cplusplus 2.8 +extern "C" { 2.9 +#endif 2.10 + 2.11 void *cx_linked_list_last(void **begin, void **end, ptrdiff_t loc_next); 2.12 2.13 int cx_linked_list_add(void **begin, void **end, ptrdiff_t loc_prev, ptrdiff_t loc_next, void *new_node); 2.14 @@ -44,4 +48,8 @@ 2.15 2.16 size_t cxLinkedListRecalculateSize(CxList list); 2.17 2.18 +#ifdef __cplusplus 2.19 +} /* extern "C" */ 2.20 +#endif 2.21 + 2.22 #endif /* UCX_LINKED_LIST_H */
3.1 --- a/src/cx/list.h Mon Mar 01 22:19:06 2021 +0100 3.2 +++ b/src/cx/list.h Sun Sep 26 11:57:27 2021 +0200 3.3 @@ -32,6 +32,10 @@ 3.4 #include <stdlib.h> 3.5 #include "allocator.h" 3.6 3.7 +#ifdef __cplusplus 3.8 +extern "C" { 3.9 +#endif 3.10 + 3.11 typedef int(*CxListComparator)(void const *left, void const *right); 3.12 3.13 typedef struct { 3.14 @@ -45,9 +49,13 @@ 3.15 3.16 typedef struct { 3.17 int (*add)(cx_list *list, void *elem); 3.18 + 3.19 int (*insert)(cx_list *list, size_t index, void *elem); 3.20 + 3.21 void *(*remove)(cx_list *list, size_t index); 3.22 + 3.23 size_t (*find)(cx_list *list, void *elem); 3.24 + 3.25 void *(*last)(cx_list *list); 3.26 } cx_list_class; 3.27 3.28 @@ -68,4 +76,8 @@ 3.29 3.30 void *cxListLast(CxList list); 3.31 3.32 +#ifdef __cplusplus 3.33 +} /* extern "C" */ 3.34 +#endif 3.35 + 3.36 #endif /* UCX_LIST_H */