Skip to content

Commit 0eaac19

Browse files
committed
Change for compatibility with Zephyr (which has no isatty()
Signed-off-by: Dave Rensberger <[email protected]>
1 parent c0a453e commit 0eaac19

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/logging.c

+8
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ static enum rcutils_get_env_retval rcutils_get_env_var_zero_or_one(
155155
const char * one_semantic)
156156
{
157157
const char * env_var_value = NULL;
158+
(void)one_semantic;
159+
(void)zero_semantic;
158160
const char * ret_str = rcutils_get_env(name, &env_var_value);
159161
if (NULL != ret_str) {
160162
RCUTILS_SET_ERROR_MSG_WITH_FORMAT_STRING(
@@ -1268,6 +1270,12 @@ rcutils_ret_t rcutils_logging_format_message(
12681270
# define COLOR_GREEN 2
12691271
# define COLOR_YELLOW 6
12701272
# define IS_STREAM_A_TTY(stream) (_isatty(_fileno(stream)) != 0)
1273+
#elif defined(__ZEPHYR__)
1274+
# define COLOR_NORMAL 0
1275+
# define COLOR_RED 0
1276+
# define COLOR_GREEN 0
1277+
# define COLOR_YELLOW 0
1278+
# define IS_STREAM_A_TTY(stream) false
12711279
#else
12721280
# define COLOR_NORMAL "\033[0m"
12731281
# define COLOR_RED "\033[31m"

0 commit comments

Comments
 (0)