From 0aa5a6e501d589daf80e7873b2ec47b3d925f813 Mon Sep 17 00:00:00 2001 From: Laurent Mazet Date: Mon, 6 Mar 2023 14:24:20 +0100 Subject: [PATCH] fix windows compilation issues --- color.c | 2 +- format.c | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/color.c b/color.c index 2af7572..7aec785 100644 --- a/color.c +++ b/color.c @@ -16,7 +16,7 @@ void color_set (FILE *fid, color_e color) if (init == 0) { CONSOLE_SCREEN_BUFFER_INFO info; GetConsoleScreenBufferInfo (GetStdHandle (STD_OUTPUT_HANDLE), &info); - init = info.attr; + init = info.wAttributes; } /* default attribute */ diff --git a/format.c b/format.c index 77e3a18..e5be2df 100644 --- a/format.c +++ b/format.c @@ -93,7 +93,9 @@ int get_ibase () return _ibase; } -char *itoa (unsigned long value) +/* multi base integer to ascii function */ + +char *mbitoa (unsigned long value) { static char str[8 * sizeof (long) + 1]; @@ -121,7 +123,7 @@ double print (double value) if (_obase == 10) { printf (_format ? _format : DEFAULT_FORMAT, value); } else { - printf ("%s%s\n", (_prompt) ? _prompt : DEFAULT_PROMPT, itoa ((unsigned int)value)); + printf ("%s%s\n", (_prompt) ? _prompt : DEFAULT_PROMPT, mbitoa ((unsigned int)value)); } return value; } @@ -131,7 +133,7 @@ double printl (double value) if (_obase == 10) { printf (_minform ? _minform : DEFAULT_MINFORM, value); } else { - printf ("%s%s", (_prompt) ? _prompt : DEFAULT_PROMPT, itoa ((unsigned int)value)); + printf ("%s%s", (_prompt) ? _prompt : DEFAULT_PROMPT, mbitoa ((unsigned int)value)); } return value; } -- 2.30.2