remove UTF-8 code when compiling with --disable-unicode

This commit is contained in:
Christian Hesse
2015-07-17 14:33:34 +02:00
parent 9e67b6585e
commit d8e23bb084
5 changed files with 51 additions and 11 deletions

14
CRT.c
View File

@ -133,6 +133,8 @@ const char *CRT_treeStrAscii[TREE_STR_COUNT] = {
"-", // TREE_STR_SHUT
};
#ifdef HAVE_LIBNCURSESW
const char *CRT_treeStrUtf8[TREE_STR_COUNT] = {
"\xe2\x94\x80", // TREE_STR_HORZ ─
"\xe2\x94\x82", // TREE_STR_VERT │
@ -143,14 +145,16 @@ const char *CRT_treeStrUtf8[TREE_STR_COUNT] = {
"\xe2\x94\x80", // TREE_STR_SHUT ─
};
bool CRT_utf8 = false;
#endif
const char **CRT_treeStr = CRT_treeStrAscii;
static bool CRT_hasColors;
int CRT_delay = 0;
bool CRT_utf8 = false;
int* CRT_colors;
int CRT_colorSchemes[LAST_COLORSCHEME][LAST_COLORELEMENT] = {
@ -596,7 +600,11 @@ void CRT_init(int delay, int colorScheme) {
CRT_utf8 = false;
#endif
CRT_treeStr = CRT_utf8 ? CRT_treeStrUtf8 : CRT_treeStrAscii;
CRT_treeStr =
#ifdef HAVE_LIBNCURSESW
CRT_utf8 ? CRT_treeStrUtf8 :
#endif
CRT_treeStrAscii;
mousemask(BUTTON1_CLICKED, NULL);
}