Re-defined iswprint() using GetStringTypeW on windows.

This commit is contained in:
dolphin6k 2021-11-05 16:55:23 +09:00
parent 1486aa8145
commit 5c669730a9

View file

@ -328,6 +328,7 @@ typedef struct safer_dirent
/* Windows */
#include <windows.h>
#include <unistd.h>
#include <dirent.h>
#include <malloc.h>
@ -336,6 +337,9 @@ typedef struct safer_dirent
#include <direct.h>
#include <iconv.h>
#undef min
#undef max
#define mkdir(path,access) _mkdir(path)
static void mtw(wchar_t * wtok, char *tok, size_t size)
@ -365,6 +369,14 @@ static void mtw(wchar_t * wtok, char *tok, size_t size)
extern int win32_trash(const char *path);
#endif
#undef iswprint
int iswprint(wchar_t wc)
{
WORD t;
GetStringTypeW(CT_CTYPE1, &wc, 1, &t);
return (t & C1_DEFINED) && !(t & C1_CNTRL);
}
#endif /* WIN32 */
#if defined(__MACOS__)