@@ -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+
4952static 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+
105110static 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