summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2025-10-16 15:57:46 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2025-10-16 15:57:46 +0300
commita2944822ba192e6bc00fdc591284ce194847c731 (patch)
treeed514565be1b17b88a107de324e01c0dc50a5756 /include
parentace7d8eff3df026f07e42122caaf35880d8289bb (diff)
downloadconts-a2944822ba192e6bc00fdc591284ce194847c731.tar.gz
conts-a2944822ba192e6bc00fdc591284ce194847c731.zip
use common include guards
+ Probably doesn't make any practical difference but feels a bit cleaner
Diffstat (limited to 'include')
-rw-r--r--include/conts/map.h12
-rw-r--r--include/conts/sptree.h22
-rw-r--r--include/conts/spvec.h4
-rw-r--r--include/conts/vec.h5
4 files changed, 24 insertions, 19 deletions
diff --git a/include/conts/map.h b/include/conts/map.h
index d6a6188..9824b2a 100644
--- a/include/conts/map.h
+++ b/include/conts/map.h
@@ -34,12 +34,6 @@
#define MAP_FREE free
#endif
-#include <stddef.h>
-#include <stdlib.h>
-#include <stdbool.h>
-
-#include "conts.h"
-
#define MAP(a) CONTS_JOIN(MAP_NAME, a)
#define MAP_TUPLE MAP(tuple)
@@ -50,6 +44,12 @@
#ifndef CONTS_MAP_H
#define CONTS_MAP_H
+#include <stddef.h>
+#include <stdlib.h>
+#include <stdbool.h>
+
+#include "conts.h"
+
/* how many times to retry placing an element in a bucket */
#define CONTS_MAP_PACKING 4
diff --git a/include/conts/sptree.h b/include/conts/sptree.h
index 15c6869..765dffc 100644
--- a/include/conts/sptree.h
+++ b/include/conts/sptree.h
@@ -1,9 +1,3 @@
-#include <stdint.h>
-#include <assert.h>
-#include <stdlib.h>
-#include <stddef.h>
-#include <stdbool.h>
-
#ifndef SPTREE_TYPE
#error "Need sptree type"
#endif
@@ -32,15 +26,21 @@
#define SPTREE_FREE free
#endif
-#include "conts.h"
-
#define SPTREE(a) CONTS_JOIN(SPTREE_NAME, a)
#define SPNODE SPTREE(node)
#define SPROOT SPTREE_NAME
-#ifndef SPTREE_H
-#define SPTREE_H
+#ifndef CONTS_SPTREE_H
+#define CONTS_SPTREE_H
+
+#include <stdint.h>
+#include <assert.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <stdbool.h>
+
+#include "conts.h"
#define sp_left(n) ((n)->left)
#define sp_right(n) ((n)->right)
@@ -48,7 +48,7 @@
#define sp_lparen(n) (sp_left(n)->parent)
#define sp_rparen(n) (sp_right(n)->parent)
-#endif /* SPTREE_H */
+#endif /* CONTS_SPTREE_H */
struct SPNODE {
int_fast16_t hint;
diff --git a/include/conts/spvec.h b/include/conts/spvec.h
index 8241455..4fffb4a 100644
--- a/include/conts/spvec.h
+++ b/include/conts/spvec.h
@@ -22,8 +22,8 @@
#define SPVEC_FREE free
#endif
-#ifndef SPVEC_H
-#define SPVEC_H
+#ifndef CONTS_SPVEC_H
+#define CONTS_SPVEC_H
/* common part */
diff --git a/include/conts/vec.h b/include/conts/vec.h
index 3d0cd66..2e93805 100644
--- a/include/conts/vec.h
+++ b/include/conts/vec.h
@@ -22,6 +22,9 @@
#define VEC_FREE free
#endif
+#ifndef CONTS_VEC_H
+#define CONTS_VEC_H
+
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
@@ -30,6 +33,8 @@
#include "conts.h"
+#endif /* CONTS_VEC_H */
+
#define VEC(a) CONTS_JOIN(VEC_NAME, a)
#define VEC_STRUCT VEC_NAME