From e053aa44ab9cbe5fef5fa17be35bdecec42f1d4d Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sat, 5 Oct 2024 22:28:24 +0100 Subject: [PATCH] Remove unnecessary termcolour header files --- .../shell/termcolour/posix/termcolour_posix.c | 1 - .../shell/termcolour/posix/termcolour_posix.h | 22 ---------------- src/common/shell/termcolour/termcolour.c | 9 +------ .../shell/termcolour/win/termcolour_win.c | 1 - .../shell/termcolour/win/termcolour_win.h | 26 ------------------- 5 files changed, 1 insertion(+), 58 deletions(-) delete mode 100644 src/common/shell/termcolour/posix/termcolour_posix.h delete mode 100644 src/common/shell/termcolour/win/termcolour_win.h diff --git a/src/common/shell/termcolour/posix/termcolour_posix.c b/src/common/shell/termcolour/posix/termcolour_posix.c index 039bc18..51cdf2f 100644 --- a/src/common/shell/termcolour/posix/termcolour_posix.c +++ b/src/common/shell/termcolour/posix/termcolour_posix.c @@ -4,7 +4,6 @@ #ifdef WAPP_PLATFORM_POSIX #include "terminal_colours.h" -#include "termcolour_posix.h" #include internal const char *colours[COUNT_TERM_COLOUR] = { diff --git a/src/common/shell/termcolour/posix/termcolour_posix.h b/src/common/shell/termcolour/posix/termcolour_posix.h deleted file mode 100644 index d589b6a..0000000 --- a/src/common/shell/termcolour/posix/termcolour_posix.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef TERM_COLOUR_POSIX_H -#define TERM_COLOUR_POSIX_H - -#include "platform.h" - -#ifdef WAPP_PLATFORM_POSIX - -#include "terminal_colours.h" - -#ifdef __cplusplus -BEGIN_C_LINKAGE -#endif // __cplusplus - -void print_coloured_text(const char *text, TerminalColour colour); - -#ifdef __cplusplus -END_C_LINKAGE -#endif // __cplusplus - -#endif // !WAPP_PLATFORM_POSIX - -#endif // !TERM_COLOUR_POSIX_H diff --git a/src/common/shell/termcolour/termcolour.c b/src/common/shell/termcolour/termcolour.c index 980b17d..0a439c2 100644 --- a/src/common/shell/termcolour/termcolour.c +++ b/src/common/shell/termcolour/termcolour.c @@ -1,14 +1,7 @@ #include "termcolour.h" #include "terminal_colours.h" -#include "platform.h" -#ifdef WAPP_PLATFORM_WINDOWS - #include "termcolour_win.h" -#elif defined(WAPP_PLATFORM_POSIX) - #include "termcolour_posix.h" -#else - #error "Unrecognised platform" -#endif +extern void print_coloured_text(const char *text, TerminalColour colour); void wapp_shell_termcolour_print_text(const char *text, TerminalColour colour) { if (colour < WAPP_TERM_COLOUR_FG_BLACK || colour > WAPP_TERM_COLOUR_FG_BR_WHITE) { diff --git a/src/common/shell/termcolour/win/termcolour_win.c b/src/common/shell/termcolour/win/termcolour_win.c index e20cd83..893e957 100644 --- a/src/common/shell/termcolour/win/termcolour_win.c +++ b/src/common/shell/termcolour/win/termcolour_win.c @@ -4,7 +4,6 @@ #ifdef WAPP_PLATFORM_WINDOWS #include "misc_utils.h" -#include "termcolour_win.h" #include "terminal_colours.h" #include diff --git a/src/common/shell/termcolour/win/termcolour_win.h b/src/common/shell/termcolour/win/termcolour_win.h deleted file mode 100644 index 2dead47..0000000 --- a/src/common/shell/termcolour/win/termcolour_win.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef TERM_COLOUR_WIN_H -#define TERM_COLOUR_WIN_H - -#include "platform.h" - -#ifdef WAPP_PLATFORM_WINDOWS - -#include "terminal_colours.h" - -#define WIN32_LEAN_AND_MEAN -#include -#include - -#ifdef __cplusplus -BEGIN_C_LINKAGE -#endif // __cplusplus - -void print_coloured_text(const char *text, TerminalColour colour); - -#ifdef __cplusplus -END_C_LINKAGE -#endif // __cplusplus - -#endif // !WAPP_PLATFORM_WINDOWS - -#endif // !TERM_COLOUR_WIN_H