summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2021-09-07 13:44:56 +0200
committerTyge Løvset <[email protected]>2021-09-07 13:44:56 +0200
commit8296ca3085c1fc0c86659000440357e1c02e9595 (patch)
tree1ede7d50afd699a5ddd7144706fcdf615d57cd8e /include
parent76f7cf932693f5ec3db6840b4aa5ceb29c51c354 (diff)
downloadSTC-modified-8296ca3085c1fc0c86659000440357e1c02e9595.tar.gz
STC-modified-8296ca3085c1fc0c86659000440357e1c02e9595.zip
Fixed a few difficult bugs. including VC compability.
Diffstat (limited to 'include')
-rw-r--r--include/stc/ccommon.h2
-rw-r--r--include/stc/clist.h2
-rw-r--r--include/stc/template.h4
-rw-r--r--include/stc/test_new_map.c14
-rw-r--r--include/stc/test_new_vec.c12
5 files changed, 17 insertions, 17 deletions
diff --git a/include/stc/ccommon.h b/include/stc/ccommon.h
index d1df91a3..bad9dc8c 100644
--- a/include/stc/ccommon.h
+++ b/include/stc/ccommon.h
@@ -53,7 +53,7 @@
/* Macro overloading feature support based on: https://rextester.com/ONP80107 */
#define c_MACRO_OVERLOAD(name, ...) \
- c_PASTE(name ## _, c_NUM_ARGS(__VA_ARGS__))(__VA_ARGS__)
+ c_PASTE3(name, _, c_NUM_ARGS(__VA_ARGS__))(__VA_ARGS__)
#define c_CONCAT(a, b) a##b
#define c_PASTE(a, b) c_CONCAT(a, b)
#define c_CONCAT3(a, b, c) a##b##c
diff --git a/include/stc/clist.h b/include/stc/clist.h
index 43790aac..8bca82e2 100644
--- a/include/stc/clist.h
+++ b/include/stc/clist.h
@@ -78,7 +78,7 @@ _c_clist_complete_types(clist_VOID, dummy);
#if !defined i_fwd
cx_deftypes(_c_clist_types, Self, i_val);
#endif
-cx_deftypes(_c_clist_complete_types, Self);
+cx_deftypes(_c_clist_complete_types, Self, dummy);
typedef i_valraw cx_rawvalue_t;
diff --git a/include/stc/template.h b/include/stc/template.h
index cfa53a5c..f0aa5634 100644
--- a/include/stc/template.h
+++ b/include/stc/template.h
@@ -27,8 +27,8 @@
#define STC_TEMPLATE_H_INCLUDED
#define cx_memb(name) c_PASTE(Self, name)
#define Self c_PASTE3(i_module, _, i_tag)
- // typedef container types defined in forward.h
- #define cx_deftypes(macro, SELF, ...) macro(SELF, __VA_ARGS__)
+ // typedef container types defined in forward.h. VC requires c_EXPAND.
+ #define cx_deftypes(macro, SELF, ...) c_EXPAND(macro(SELF, __VA_ARGS__))
#define cx_value_t cx_memb(_value_t)
#define cx_key_t cx_memb(_key_t)
diff --git a/include/stc/test_new_map.c b/include/stc/test_new_map.c
index b59bd145..3a40a501 100644
--- a/include/stc/test_new_map.c
+++ b/include/stc/test_new_map.c
@@ -1,5 +1,5 @@
-#include "cstr.h"
-#include "forward.h"
+#include <stc/cstr.h>
+#include <stc/forward.h>
forward_cmap(pnt, struct Point, int);
@@ -11,7 +11,7 @@ struct MyStruct {
#define i_key int
#define i_val int
-#include "cmap.h"
+#include <stc/cmap.h>
struct Point { int x, y; } typedef Point;
int point_compare(const Point* a, const Point* b) {
@@ -22,14 +22,14 @@ int point_compare(const Point* a, const Point* b) {
#define i_key Point
#define i_val int
#define i_cmp point_compare
-#include "cmap.h"
+#include <stc/cmap.h>
#define i_key_str
#define i_val_str
-#include "cmap.h"
+#include <stc/cmap.h>
#define i_key_str
-#include "cset.h"
+#include <stc/cset.h>
int main()
@@ -54,4 +54,4 @@ int main()
cset_str sset = cset_str_init();
cset_str_emplace(&sset, "Hello, friend");
cset_str_del(&sset);
- } \ No newline at end of file
+} \ No newline at end of file
diff --git a/include/stc/test_new_vec.c b/include/stc/test_new_vec.c
index 3cc770da..88c71679 100644
--- a/include/stc/test_new_vec.c
+++ b/include/stc/test_new_vec.c
@@ -1,5 +1,5 @@
-#include "cstr.h"
-#include "forward.h"
+#include <stc/cstr.h>
+#include <stc/forward.h>
forward_cvec(i32, int);
forward_cvec(pnt, struct Point);
@@ -12,7 +12,7 @@ struct MyStruct {
#define f_tag i32
#define i_val int
-#include "cvec.h"
+#include <stc/cvec.h>
struct Point { int x, y; } typedef Point;
int point_compare(const Point* a, const Point* b) {
@@ -22,13 +22,13 @@ int point_compare(const Point* a, const Point* b) {
#define f_tag pnt
#define i_val Point
#define i_cmp point_compare
-#include "cvec.h"
+#include <stc/cvec.h>
#define i_val float
-#include "cvec.h"
+#include <stc/cvec.h>
#define i_val_str
-#include "cvec.h"
+#include <stc/cvec.h>
int main()