diff options
author | David Phillips <david@sighup.nz> | 2018-05-16 19:25:58 +1200 |
---|---|---|
committer | David Phillips <david@sighup.nz> | 2018-05-16 19:26:41 +1200 |
commit | 39176a1d06dccae9340383f818a556df4cea3335 (patch) | |
tree | f4af127b47fc91d57b8a1d27406649d50f3f3534 /colour.h | |
parent | ff5a11ed6d0eeb8ed449e923abf68bc603f41926 (diff) | |
download | sand-leek-39176a1d06dccae9340383f818a556df4cea3335.tar.xz |
Add compile-time flag to disable coloured output
Turns out windows builds run in plain powershell or cmd.exe display the
raw ANSI escape sequences rather than interpreting. No official support
for interpreting them that I can see.
Diffstat (limited to 'colour.h')
-rw-r--r-- | colour.h | 35 |
1 files changed, 34 insertions, 1 deletions
@@ -1,6 +1,8 @@ #ifndef SAND_LEEK_COLOUR_H #define SAND_LEEK_COLOUR_H +#ifndef SAND_LEEK_DISABLE_COLOUR + #define ANSI_ESC "\x1b[" #define COLOUR_BLACK ANSI_ESC"30m" #define COLOUR_RED ANSI_ESC"31m" @@ -28,4 +30,35 @@ #define COLOUR_ERASE ANSI_ESC"2K" -#endif +#else /* ifndef SAND_LEEK_DISABLE_COLOUR */ + +#define ANSI_ESC "" +#define COLOUR_BLACK "" +#define COLOUR_RED "" +#define COLOUR_GREEN "" +#define COLOUR_YELLOW "" +#define COLOUR_BLUE "" +#define COLOUR_MAGENTA "" +#define COLOUR_CYAN "" +#define COLOUR_WHITE "" + +#define COLOUR_BBLACK "" +#define COLOUR_BRED "" +#define COLOUR_BGREEN "" +#define COLOUR_BYELLOW "" +#define COLOUR_BBLUE "" +#define COLOUR_BMAGENTA "" +#define COLOUR_BCYAN "" +#define COLOUR_BWHITE "" + +#define COLOUR_BOLD "" +#define COLOUR_BOLD_OFF "" + +#define COLOUR_OFF "" +#define COLOUR_ALL_OFF "" + +#define COLOUR_ERASE "" + +#endif /* ifndef SAND_LEEK_DISABLE_COLOUR */ + +#endif /* #ifndef SAND_LEEK_COLOUR_H */ |