X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Fwcwidth.h;h=76673da658455f317aba195f7f4a9a1d802f7460;hp=ccae41a9b994ddebcd731540e538036d2aefa4ef;hb=deb0d07e8eb4803b9e9653359eab17a30d04369d;hpb=d61c3c6a831d18ef0ed6f797ac97d60fffc2f158 diff --git a/ncurses/wcwidth.h b/ncurses/wcwidth.h index ccae41a9..76673da6 100644 --- a/ncurses/wcwidth.h +++ b/ncurses/wcwidth.h @@ -59,6 +59,16 @@ * Latest version: http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c */ +#ifndef _WCWIDTH_H_incl +#define _WCWIDTH_H_incl 1 + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + #include struct interval { @@ -187,7 +197,7 @@ NCURSES_EXPORT(int) mk_wcwidth(wchar_t ucs) /* if we arrive here, ucs is not a combining or C0/C1 control character */ - return 1 + + return 1 + (ucs >= 0x1100 && (ucs <= 0x115f || /* Hangul Jamo init. consonants */ ucs == 0x2329 || ucs == 0x232a || @@ -310,3 +320,9 @@ NCURSES_EXPORT(int) mk_wcswidth_cjk(const wchar_t *pwcs, size_t n) return width; } + +#ifdef __cplusplus +} +#endif + +#endif /* _WCWIDTH_H_incl 1 */