From 1c2d67ded70548fbc90e5a289102678fc712efa9 Mon Sep 17 00:00:00 2001 From: Sergey Lyubka Date: Wed, 30 Mar 2022 09:06:00 +0100 Subject: [PATCH] Add missing arch_zephyr.h, add musl target --- Makefile | 5 +++++ src/arch_zephyr.h | 27 +++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 src/arch_zephyr.h diff --git a/Makefile b/Makefile index ad1295ea..a2f2c10c 100644 --- a/Makefile +++ b/Makefile @@ -60,6 +60,11 @@ test++: C_WARN = test++: WARN += -Wno-shadow -Wno-missing-field-initializers -Wno-deprecated test++: test +musl: test +musl: ASAN = +musl: WARN += -Wno-sign-conversion +musl: CC = $(DOCKER) mdashnet/cc1 gcc + # Make sure we can build from an unamalgamated sources unamalgamated: $(HDRS) Makefile test/packed_fs.c $(CC) src/*.c test/packed_fs.c test/unit_test.c $(CFLAGS) $(LDFLAGS) -g -o unit_test diff --git a/src/arch_zephyr.h b/src/arch_zephyr.h new file mode 100644 index 00000000..ad1ea4aa --- /dev/null +++ b/src/arch_zephyr.h @@ -0,0 +1,27 @@ +#pragma once + +#if MG_ARCH == MG_ARCH_ZEPHYR + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define strerror(x) zsock_gai_strerror(x) +#define FD_CLOEXEC 0 +#define F_SETFD 0 + +int rand(void); +int sscanf(const char *, const char *, ...); + +#endif