summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2021-04-28 17:30:51 +0200
committerFlorin Coras <florin.coras@gmail.com>2021-04-28 17:23:22 +0000
commitedca8c6e753380f12d23e9ee4e0a9be4e24c43a8 (patch)
treed289767cbdb3807242257056aca6aa76affa79b8 /src
parentdf6d986f81f89ed46288ab508485700b4ed7dca1 (diff)
vppinfra: don't fail if config.h is missing, fallback to defaults instead
Type: improvement Change-Id: Idc82d40a16cbc8a401a8fb359bc63083f47361b9 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src')
-rw-r--r--src/vppinfra/clib.h3
-rw-r--r--src/vppinfra/vec.c4
2 files changed, 7 insertions, 0 deletions
diff --git a/src/vppinfra/clib.h b/src/vppinfra/clib.h
index 7cdf4a41aaa..ade7e5fa4bb 100644
--- a/src/vppinfra/clib.h
+++ b/src/vppinfra/clib.h
@@ -39,7 +39,10 @@
#define included_clib_h
#include <stddef.h>
+
+#if __has_include(<vppinfra/config.h>)
#include <vppinfra/config.h>
+#endif
#ifdef __x86_64__
#include <x86intrin.h>
diff --git a/src/vppinfra/vec.c b/src/vppinfra/vec.c
index e98b5825156..970f7f7bfa8 100644
--- a/src/vppinfra/vec.c
+++ b/src/vppinfra/vec.c
@@ -38,6 +38,10 @@
#include <vppinfra/vec.h>
#include <vppinfra/mem.h>
+#ifndef CLIB_VECTOR_GROW_BY_ONE
+#define CLIB_VECTOR_GROW_BY_ONE 0
+#endif
+
/* Vector resize operator. Called as needed by various macros such as
vec_add1() when we need to allocate memory. */
__clib_export void *