commit a76d800a28111c7753274bf8f78412a7a88927af
parent 12bdfefcd7ced3079d7a4ee4bd8db249c51b3f31
Author: Robert Russell <robertrussell.72001@gmail.com>
Date: Sun, 24 Sep 2023 13:24:14 -0700
Always include alloc.h in list
Otherwise the user could redefine the allocator to some other
allocator in alloc.h and it wouldn't be included.
Diffstat:
4 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/inc/list/declare.h b/inc/list/declare.h
@@ -1,3 +1,4 @@
+#include "../alloc.h"
#include "../def.h"
#include "impl/macro.h"
diff --git a/inc/list/define.h b/inc/list/define.h
@@ -1,6 +1,7 @@
#include <errno.h>
#include <string.h>
+#include "../alloc.h"
#include "../def.h"
#include "../internal/util.h"
diff --git a/inc/list/impl/macro.h b/inc/list/impl/macro.h
@@ -10,12 +10,10 @@
#define LIST_MIN_CAP 8
#endif
-#if !defined(LIST_REALLOC) || !defined(LIST_FREE)
-#include "../../alloc.h"
-#endif
#ifndef LIST_REALLOC
#define LIST_REALLOC r_erealloc
#endif
+
#ifndef LIST_FREE
#define LIST_FREE free
#endif
diff --git a/inc/list/static.h b/inc/list/static.h
@@ -1,6 +1,7 @@
#include <errno.h>
#include <string.h>
+#include "../alloc.h"
#include "../def.h"
#include "../internal/util.h"