diff --git a/form/frm_driver.c b/form/frm_driver.c index 75656d69..ce690dcb 100644 --- a/form/frm_driver.c +++ b/form/frm_driver.c @@ -104,6 +104,14 @@ Perhaps at some time we will make this configurable at runtime. #define myINSNSTR(w, s, n) wide_winsnstr(w, s, n) #define myINNSTR(w, s, n) wide_winnstr(w, s, n) #define myWCWIDTH(w, y, x) cell_width(w, y, x) + +//MLA-begin +#ifdef __MORPHOS__ +#define wcwidth morphos_wcwidth +int wcwidth(wchar_t ucs); +#endif +//MLA-end + #else #define myADDNSTR(w, s, n) waddnstr(w, s, n) #define myINSNSTR(w, s, n) winsnstr(w, s, n) diff --git a/menu/m_global.c b/menu/m_global.c index 4ec08c52..ea9c91e7 100644 --- a/menu/m_global.c +++ b/menu/m_global.c @@ -249,6 +249,13 @@ _nc_Disconnect_Items(MENU *menu) | | Return Values : the width +--------------------------------------------------------------------------*/ +//MLA-begin +#ifdef __MORPHOS__ +#define wcwidth morphos_wcwidth +int wcwidth(wchar_t ucs); +#endif +//MLA-end + MENU_EXPORT(int) _nc_Calculate_Text_Width(const TEXT *item /*FIXME: limit length */ ) { diff --git a/ncurses/tinfo/lib_acs.c b/ncurses/tinfo/lib_acs.c index 4ede53f6..8ace3e61 100644 --- a/ncurses/tinfo/lib_acs.c +++ b/ncurses/tinfo/lib_acs.c @@ -257,6 +257,13 @@ _nc_init_acs(void) #endif #if !NCURSES_WCWIDTH_GRAPHICS +//MLA-begin +#ifdef __MORPHOS__ +#define wcwidth morphos_wcwidth +int wcwidth(wchar_t ucs); +#endif +//MLA-end + NCURSES_EXPORT(int) _nc_wacs_width(unsigned ch) { diff --git a/test/ins_wide.c b/test/ins_wide.c index c99b19d6..2f625258 100644 --- a/test/ins_wide.c +++ b/test/ins_wide.c @@ -104,6 +104,13 @@ legend(WINDOW *win, int level, Options state, wchar_t *buffer, int length) waddwstr(win, buffer); waddstr(win, ">"); } +//MLA-begin +#ifdef __MORPHOS__ +#define wcwidth morphos_wcwidth +int wcwidth(wchar_t ucs); +#endif +//MLA-end + static int ColOf(const wchar_t *buffer, int length, int margin) diff --git a/test/key_names.c b/test/key_names.c index 69c95d63..a5126f34 100644 --- a/test/key_names.c +++ b/test/key_names.c @@ -33,6 +33,12 @@ #include #if USE_WIDEC_SUPPORT +//MLA-begin +#ifdef __MORPHOS__ +#define wcwidth morphos_wcwidth +int wcwidth(wchar_t ucs); +#endif +//MLA-end static void usage(void) diff --git a/test/ncurses.c b/test/ncurses.c index 2aa78b22..8fc316f5 100644 --- a/test/ncurses.c +++ b/test/ncurses.c @@ -3955,6 +3955,13 @@ merge_wide_attr(cchar_t *dst, const cchar_t *src, attr_t attr, NCURSES_PAIRS_T p * characters (1024 total). However, taking repeats and double-width cells * into account, use 256 characters for the page. */ +//MLA-begin +#ifdef __MORPHOS__ +#define wcwidth morphos_wcwidth +int wcwidth(wchar_t ucs); +#endif +//MLA-end + static void show_paged_widechars(unsigned base, unsigned pagesize, diff --git a/test/savescreen.c b/test/savescreen.c index 4c767a52..38bdd701 100644 --- a/test/savescreen.c +++ b/test/savescreen.c @@ -163,6 +163,12 @@ get_command(int color, int which, int last) return ch; } +//MLA-begin +#ifdef __MORPHOS__ +#define wcwidth morphos_wcwidth +int wcwidth(wchar_t ucs); +#endif +//MLA-end static int dump_screen(char **files, int color, int which, int last, bool use_colors) diff --git a/test/test_add_wchstr.c b/test/test_add_wchstr.c index b1605046..3a91f042 100644 --- a/test/test_add_wchstr.c +++ b/test/test_add_wchstr.c @@ -190,6 +190,14 @@ legend(WINDOW *win, int level, Options state, wchar_t *buffer, int length) waddstr(win, ">"); } +//MLA-begin +#ifdef __MORPHOS__ +#define wcwidth morphos_wcwidth +int wcwidth(wchar_t ucs); +#endif +//MLA-end + + static int ColOf(const wchar_t *buffer, int length, int margin) { diff --git a/test/test_addwstr.c b/test/test_addwstr.c index 22cacb91..3a8f83df 100644 --- a/test/test_addwstr.c +++ b/test/test_addwstr.c @@ -113,6 +113,13 @@ legend(WINDOW *win, int level, Options state, wchar_t *buffer, int length) waddstr(win, ">"); } +//MLA-begin +#ifdef __MORPHOS__ +#define wcwidth morphos_wcwidth +int wcwidth(wchar_t ucs); +#endif +//MLA-end + static int ColOf(wchar_t *buffer, int length, int margin) { diff --git a/test/view.c b/test/view.c index b368f5b7..3cc03360 100644 --- a/test/view.c +++ b/test/view.c @@ -86,6 +86,13 @@ failed(const char *msg) ExitProgram(EXIT_FAILURE); } +//MLA-begin +#ifdef __MORPHOS__ +#define wcwidth morphos_wcwidth +int wcwidth(wchar_t ucs); +#endif +//MLA-end + static int ch_len(NCURSES_CH_T *src) {