commit a4fbab1bc49397ad153cd0d75db52315cd210628
parent 2c8a05b8636840abd0873a0473e0354dfa395e2e
Author: Robert Russell <robertrussell.72001@gmail.com>
Date: Sat, 7 Oct 2023 20:29:50 -0700
Report error for misnamed allocator options
Diffstat:
4 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/inc/dict/impl/macros.h b/inc/dict/impl/macros.h
@@ -6,6 +6,10 @@
#error "rcx/dict: DICT_METHOD must be defined"
#endif
+#if defined(DICT_ALLOC) || defined(DICT_REALLOC) || defined(DICT_REALLOCZ)
+#error "rcx/dict: invalid allocator option; use DICT_ALLOCZ"
+#endif
+
#ifndef DICT_K
#error "rcx/dict: DICT_K must be defined"
#endif
diff --git a/inc/list/impl/macros.h b/inc/list/impl/macros.h
@@ -9,6 +9,10 @@
#error "rcx/list: LIST_METHOD must be defined"
#endif
+#if defined(LIST_ALLOC) || defined(LIST_ALLOCZ) || defined(LIST_REALLOCZ)
+#error "rcx/list: invalid allocator option; use LIST_REALLOC"
+#endif
+
#ifndef LIST_T
#error "rcx/list: LIST_T must be defined"
#endif
diff --git a/inc/set/impl/macros.h b/inc/set/impl/macros.h
@@ -6,6 +6,10 @@
#error "rcx/set: SET_METHOD must be defined"
#endif
+#if defined(SET_ALLOC) || defined(SET_REALLOC) || defined(SET_REALLOCZ)
+#error "rcx/set: invalid allocator option; use SET_ALLOCZ"
+#endif
+
#ifndef SET_T
#error "rcx/set: SET_T must be defined"
#endif
diff --git a/inc/table/impl/macros.h b/inc/table/impl/macros.h
@@ -9,6 +9,10 @@
#error "rcx/table: TABLE_METHOD must be defined"
#endif
+#if defined(TABLE_ALLOC) || defined(TABLE_REALLOC) || defined(TABLE_REALLOCZ)
+#error "rcx/table: invalid allocator option; use TABLE_ALLOCZ"
+#endif
+
#ifndef TABLE_KSIZE
#define TABLE_KSIZE r_spec_->ksize
#define TABLE_KSIZE_FIELD usize ksize;