diff options
author | Alan Coopersmith <alan.coopersmith@sun.com> | 2007-04-11 20:15:00 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@sun.com> | 2007-04-11 20:15:00 -0700 |
commit | ee6e61225943ec77c8b97ae8115ce37c42e8c16e (patch) | |
tree | 8e9f9c6015d2d79d7e97bb56d137bdb279bb65b0 /src | |
parent | eccdec2bf4680b42036f03a7ce0ae9bfe5ef5374 (diff) | |
download | xorg-lib-libXaw-ee6e61225943ec77c8b97ae8115ce37c42e8c16e.tar.gz |
Use iswalnum() if it's present as a function, not just if it's #defined
Also fixes X.Org bugzilla #8564
Diffstat (limited to 'src')
-rw-r--r-- | src/XawI18n.c | 6 | ||||
-rw-r--r-- | src/XawI18n.h | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/XawI18n.c b/src/XawI18n.c index ca95866..345bc7d 100644 --- a/src/XawI18n.c +++ b/src/XawI18n.c @@ -96,9 +96,13 @@ _Xaw_iswspace(wchar_t w) int _Xaw_iswalnum(wchar_t ch) { - unsigned char mb[sizeof(wchar_t)]; +#ifdef HAVE_ISWALNUM + return iswalnum(ch); +#else + unsigned char mb[MB_LEN_MAX]; wctomb((char*)mb, ch); return (isalnum(*mb)); +#endif } diff --git a/src/XawI18n.h b/src/XawI18n.h index 69ac2d8..45cb9a5 100644 --- a/src/XawI18n.h +++ b/src/XawI18n.h @@ -113,7 +113,7 @@ wchar_t _Xaw_atowc #endif #endif -#ifndef iswalnum +#if !defined(iswalnum) && !defined(HAVE_ISWALNUM) #define iswalnum(c) _Xaw_iswalnum(c) int _Xaw_iswalnum ( |