summaryrefslogtreecommitdiffhomepage
path: root/include/stc/clist.h
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-01-02 14:18:22 +0100
committerTyge Løvset <[email protected]>2022-01-02 14:18:22 +0100
commit9826f52e385e1ec019c63fd483f1c8acccf4a360 (patch)
tree415a95e035b35995781392f04cf0c0bcb986b41c /include/stc/clist.h
parent8134d0f62ebc659741131eb79cec4fdcf5f774f7 (diff)
downloadSTC-modified-9826f52e385e1ec019c63fd483f1c8acccf4a360.tar.gz
STC-modified-9826f52e385e1ec019c63fd483f1c8acccf4a360.zip
Simplified and improved linkage configuration. Reorganized crandom.h a bit.
May define "i_opt c_shared", or "i_opt c_static" to specify individual container linkage, based on if STC_HEADER is defined, i.e static linkage is default, STC_HEADER defined makes shared symbols default.
Diffstat (limited to 'include/stc/clist.h')
-rw-r--r--include/stc/clist.h16
1 files changed, 6 insertions, 10 deletions
diff --git a/include/stc/clist.h b/include/stc/clist.h
index b9a3df24..d53c35c8 100644
--- a/include/stc/clist.h
+++ b/include/stc/clist.h
@@ -51,9 +51,9 @@
}
}
*/
+#include "ccommon.h"
#ifndef CLIST_H_INCLUDED
-#include "ccommon.h"
#include "forward.h"
#include <stdlib.h>
#include <string.h>
@@ -75,7 +75,6 @@ _c_clist_complete_types(clist_VOID, dummy);
else entry->next = entry; \
entry->value = val
// +: set self->last based on node
-
#endif // CLIST_H_INCLUDED
#ifndef _i_prefix
@@ -184,8 +183,7 @@ _cx_memb(_get_mut)(_cx_self* self, i_valraw val) {
#endif
// -------------------------- IMPLEMENTATION -------------------------
-
-#if !defined(STC_SHARED) || c_option(c_static) || defined(STC_IMPLEMENTATION)
+#if defined(_i_implement)
#if !c_option(c_no_clone)
STC_DEF _cx_self
@@ -330,10 +328,7 @@ _cx_memb(_value_cmp)(const _cx_value* x, const _cx_value* y) {
}
#endif // !c_no_cmp
-#endif // TEMPLATE IMPLEMENTATION
-
-#if !defined(CLIST_H_INCLUDED) && \
- (!defined(STC_SHARED) || c_option(c_static) || defined(STC_IMPLEMENTATION))
+#ifndef CLIST_H_INCLUDED
STC_DEF size_t
_clist_count(const clist_VOID* self) {
@@ -395,6 +390,7 @@ _clist_mergesort(clist_VOID_node *list, int (*cmp)(const clist_VOID_node*, const
}
}
#endif // !c_no_cmp
-#endif // NON-TEMPLATE IMPLEMENTATION
-#include "template.h"
+#endif // !CLIST_H_INCLUDED
+#endif // _i_implement
#define CLIST_H_INCLUDED
+#include "template.h"