File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,10 @@ extern "C" {
4646
4747#define STR (x ) #x
4848#define XSTR (x ) STR(x)
49+
50+ #ifndef __ZEPHYR__
4951#define STRINGIFY (x ) #x
52+ #endif
5053
5154#define ROUND_UP (x , y ) ((x + y - 1) & ~ (y - 1))
5255
@@ -132,6 +135,7 @@ extern "C" {
132135#endif
133136
134137#if (defined(_WIN32 ) || defined(_WIN64 ))
138+
135139#include <io.h>
136140#define isatty _isatty /* from io.h */
137141#define fileno _fileno
@@ -142,7 +146,17 @@ extern "C" {
142146#define likely (p ) (p)
143147#define unlikely (p ) (p)
144148#define PATH_SEPARATOR '\\'
149+
150+ #elif defined(__ZEPHYR__ )
151+
152+ #include <zephyr/toolchain.h> // __weak, __builtin_xxx() etc.,
153+
154+ #define PATH_SEPARATOR '/'
155+ #define __unreachable () __builtin_unreachable()
156+ #define __format_printf (x , y ) __attribute__((format(printf, x, y)))
157+
145158#else
159+
146160#define __format_printf (x , y ) __attribute__((format(printf, x, y)))
147161#define __noreturn __attribute__((noreturn))
148162#define __weak __attribute__((weak))
You can’t perform that action at this time.
0 commit comments