From 3b22cf6078d81c2d8676248fa9df2d71739030c6 Mon Sep 17 00:00:00 2001 From: szdytom Date: Sun, 25 Jun 2023 13:49:26 +0800 Subject: [PATCH] support for some old compilers --- native/standalone/stdbool.h | 14 ++++++++++++++ native/standalone/stdnoreturn.h | 10 ++++++++++ xmake.lua | 1 + 3 files changed, 25 insertions(+) create mode 100644 native/standalone/stdbool.h create mode 100644 native/standalone/stdnoreturn.h diff --git a/native/standalone/stdbool.h b/native/standalone/stdbool.h new file mode 100644 index 0000000..1a95e72 --- /dev/null +++ b/native/standalone/stdbool.h @@ -0,0 +1,14 @@ +#ifndef _ACC_STDBOOL_H +#define _ACC_STDBOOL_H + +#ifndef __cplusplus + +#define bool _Bool +#define true 1 +#define false 0 + +#endif + +#define __bool_true_false_are_defined 1 + +#endif diff --git a/native/standalone/stdnoreturn.h b/native/standalone/stdnoreturn.h new file mode 100644 index 0000000..6cdfb53 --- /dev/null +++ b/native/standalone/stdnoreturn.h @@ -0,0 +1,10 @@ +#ifndef _ACC_STD_NORETURN_H +#define _ACC_STD_NORETURN_H + +#ifndef __cplusplus + +#define noreturn _Noreturn + +#endif + +#endif diff --git a/xmake.lua b/xmake.lua index 5f65e01..ce5d114 100644 --- a/xmake.lua +++ b/xmake.lua @@ -13,6 +13,7 @@ target("build") add_files("src/**.c") add_files("main.c") add_includedirs("include/") + add_includedirs("native/standalone/") if is_mode("release") then set_strip("all") set_optimize("faster")