summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@sun.com>2007-04-11 20:15:00 -0700
committerAlan Coopersmith <alan.coopersmith@sun.com>2007-04-11 20:15:00 -0700
commitee6e61225943ec77c8b97ae8115ce37c42e8c16e (patch)
tree8e9f9c6015d2d79d7e97bb56d137bdb279bb65b0 /src
parenteccdec2bf4680b42036f03a7ce0ae9bfe5ef5374 (diff)
downloadxorg-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.c6
-rw-r--r--src/XawI18n.h2
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
(