diff options
-rw-r--r-- | include/compile_time_macros.h | 2 | ||||
-rw-r--r-- | include/ec_commands.h | 7 | ||||
-rw-r--r-- | include/util.h | 6 |
3 files changed, 14 insertions, 1 deletions
diff --git a/include/compile_time_macros.h b/include/compile_time_macros.h index 15432549d3..3844898084 100644 --- a/include/compile_time_macros.h +++ b/include/compile_time_macros.h @@ -83,7 +83,7 @@ */ #ifndef CONFIG_ZEPHYR #define GENMASK(h, l) (((BIT(h)<<1) - 1) ^ (BIT(l) - 1)) -#endif #define GENMASK_ULL(h, l) (((BIT_ULL(h)<<1) - 1) ^ (BIT_ULL(l) - 1)) +#endif #endif /* __CROS_EC_COMPILE_TIME_MACROS_H */ diff --git a/include/ec_commands.h b/include/ec_commands.h index 6089fc1eb0..a59e75c800 100644 --- a/include/ec_commands.h +++ b/include/ec_commands.h @@ -56,6 +56,12 @@ extern "C" { #define BIT_ULL(nr) (1ULL << (nr)) #endif +/* + * When building Zephyr, this file ends up being included before Zephyr's + * include/sys/util.h so causes a warning there. We don't want to add an #ifdef + * in that file since it won't be accepted upstream. So work around it here. + */ +#ifndef CONFIG_ZEPHYR #ifndef GENMASK #define GENMASK(h, l) (((BIT(h) << 1) - 1) ^ (BIT(l) - 1)) #endif @@ -63,6 +69,7 @@ extern "C" { #ifndef GENMASK_ULL #define GENMASK_ULL(h, l) (((BIT_ULL(h) << 1) - 1) ^ (BIT_ULL(l) - 1)) #endif +#endif #endif /* __KERNEL__ */ diff --git a/include/util.h b/include/util.h index 3d788d01cb..2be43bddfb 100644 --- a/include/util.h +++ b/include/util.h @@ -95,11 +95,17 @@ extern "C" { /* Standard library functions */ int atoi(const char *nptr); + +#ifdef CONFIG_ZEPHYR +#include <ctype.h> +#else int isdigit(int c); int isspace(int c); int isalpha(int c); int isupper(int c); int isprint(int c); +#endif + int memcmp(const void *s1, const void *s2, size_t len); void *memcpy(void *dest, const void *src, size_t len); void *memset(void *dest, int c, size_t len); |