fix missing extern "C"

Sun, 26 Sep 2021 11:57:27 +0200

author
Mike Becker <universe@uap-core.de>
date
Sun, 26 Sep 2021 11:57:27 +0200
changeset 415
067aa769796a
parent 414
81a4c3a63e65
child 416
a79b2388db5e

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
--- a/src/cx/allocator.h	Mon Mar 01 22:19:06 2021 +0100
+++ b/src/cx/allocator.h	Sun Sep 26 11:57:27 2021 +0200
@@ -31,6 +31,10 @@
 
 #include <stdlib.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef struct {
     void *(*malloc)(void *data, size_t n);
     void *(*realloc)(void *data, void *mem, size_t n);
@@ -58,4 +62,8 @@
 
 void cxFree(CxAllocator allocator, void *mem);
 
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
 #endif /* UCX_ALLOCATOR_H */
--- a/src/cx/linked_list.h	Mon Mar 01 22:19:06 2021 +0100
+++ b/src/cx/linked_list.h	Sun Sep 26 11:57:27 2021 +0200
@@ -32,6 +32,10 @@
 #include <stddef.h>
 #include "list.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 void *cx_linked_list_last(void **begin, void **end, ptrdiff_t loc_next);
 
 int cx_linked_list_add(void **begin, void **end, ptrdiff_t loc_prev, ptrdiff_t loc_next, void *new_node);
@@ -44,4 +48,8 @@
 
 size_t cxLinkedListRecalculateSize(CxList list);
 
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
 #endif /* UCX_LINKED_LIST_H */
--- a/src/cx/list.h	Mon Mar 01 22:19:06 2021 +0100
+++ b/src/cx/list.h	Sun Sep 26 11:57:27 2021 +0200
@@ -32,6 +32,10 @@
 #include <stdlib.h>
 #include "allocator.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef int(*CxListComparator)(void const *left, void const *right);
 
 typedef struct {
@@ -45,9 +49,13 @@
 
 typedef struct {
     int (*add)(cx_list *list, void *elem);
+
     int (*insert)(cx_list *list, size_t index, void *elem);
+
     void *(*remove)(cx_list *list, size_t index);
+
     size_t (*find)(cx_list *list, void *elem);
+
     void *(*last)(cx_list *list);
 } cx_list_class;
 
@@ -68,4 +76,8 @@
 
 void *cxListLast(CxList list);
 
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
 #endif /* UCX_LIST_H */

mercurial