Skip to content

Commit 63bcebc

Browse files
committed
add missing include and ifdef guard for CRT_utf8
1 parent f488db9 commit 63bcebc

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

CommandScreen.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ in the source distribution for its full text.
1818
#include <wctype.h>
1919
#include <locale.h>
2020

21+
#include "CRT.h"
2122
#include "Macros.h"
2223
#include "Panel.h"
2324
#include "ProvideCurses.h"
@@ -46,6 +47,8 @@ static int CommandScreen_scanAscii(InfoScreen* this, const char* p, size_t total
4647
return line_offset;
4748
}
4849

50+
#ifdef HAVE_LIBNCURSESW
51+
4952
static int CommandScreen_scanWide(InfoScreen* this, const char* p, size_t total, char* line) {
5053
mbstate_t state;
5154
memset(&state, 0, sizeof(state));
@@ -102,6 +105,8 @@ static int CommandScreen_scanWide(InfoScreen* this, const char* p, size_t total,
102105
return line_offset;
103106
}
104107

108+
#endif // HAVE_LIBNCURSESW
109+
105110
static void CommandScreen_scan(InfoScreen* this) {
106111
Panel* panel = this->display;
107112
int idx = Panel_getSelectedIndex(panel);
@@ -112,8 +117,11 @@ static void CommandScreen_scan(InfoScreen* this) {
112117
size_t total = strlen(p);
113118
char line[total + 1];
114119

115-
int line_offset = CRT_utf8 ? CommandScreen_scanWide(this, p, total, line)
116-
: CommandScreen_scanAscii(this, p, total, line);
120+
int line_offset =
121+
#ifdef HAVE_LIBNCURSESW
122+
CRT_utf8 ? CommandScreen_scanWide(this, p, total, line) :
123+
#endif
124+
CommandScreen_scanAscii(this, p, total, line);
117125

118126
assert(line_offset >= 0 && (size_t)line_offset <= total);
119127
if (line_offset > 0) {

0 commit comments

Comments
 (0)