When on Cygwin, you might better use Cygwin's(*) wcwidth function. It's
based on the same code from Markus Kuhn, but it interacts with the
setlocale function to make sure that the width returned for the CJK
ambiguous width characters makes sense in the given locale. Plus, it
supports a Cygwin-specific locale modifier '@cjknarrow' which allows the
user to modify this behaviour. When using your own wcwidth, you're
giving up on this feature.
And if you don't mind [L]GPL licensing, gnulib provides a source code
replacement that guarantees wide character support on all modern porting
platforms (particularly useful for mingw, which is sorely lacking on
this front); and is currently working on introducing a wwchar_t type
that is guaranteed to be UTF-32 even on cygwin (this is how coreutils
gets wide character support for things like wc). Portions of that
gnulib code are incorporated into libunistring. But from the sounds of
your program's license, I'm not sure you can take advantage of gnulib or
libunistring.