Hi/2. Paul Eggert wrote: > KO Myung-Hun wrote: >> +#ifdef __KLIBC__ >> +/* To avoid 'conflicting types' error for `__wcwidth' on OS/2 kLIBC. >> + wchar_t(unsigned short) is defined differently from wint_t(int) on >> + OS/2 kLIBC. */ >> +# undef wcwidth >> +/* Ignore wcwidth() of OS/2 kLIBC */ >> +# undef HAVE_WCWIDTH >> +#endif > > The #undef is redundant, since it's about to happen anyway. >
Do you mean HAVE_WCWIDTH ? > Why is HAVE_WCWIDTH defined? As I understand it, wcwidth is merely a > macro in kLIBC, not a function, so HAVE_WCWIDTH shouldn't be 1. > Sorry, it's my mistake. HAVE_WCWIDTH is not defined. > Put the comment first, and then the code. I don't understand what you mean. Do you mean that do not mix comments and macro definitions ? > The code change should be > pretty simple; all you need to do is replace the existing '#if > HAVE_WCWIDTH' with '#if HAVE_WCWIDTH && !defined __KLIBC__'. This comment is for whole this patch or for #undef HAVE_WCWIDTH only ? Anyway removed #undef HAVE_WCWIDTH part. -- KO Myung-Hun Using Mozilla SeaMonkey 2.7.2 Under OS/2 Warp 4 for Korean with FixPak #15 In VirtualBox v4.1.32 on Intel Core i7-3615QM 2.30GHz with 8GB RAM Korean OS/2 User Community : http://www.ecomstation.co.kr
From 5eff2e5a7f21cf290d85eb14f258242fe4b4f825 Mon Sep 17 00:00:00 2001 From: KO Myung-Hun <k...@chollian.net> Date: Fri, 28 Nov 2014 16:04:12 +0900 Subject: [PATCH] wcwidth: fix 'conflicting types' error for `__wcwidth' on OS/2 kLIBC wchar_t(unsigned short) is defined differently from wint_t(int) on OS/2 kLIBC. * lib/wcwidth.c (wcwidth): Undefine on OS/2 kLIBC. --- lib/wcwidth.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/wcwidth.c b/lib/wcwidth.c index d7837bb..2f8dc26 100644 --- a/lib/wcwidth.c +++ b/lib/wcwidth.c @@ -26,6 +26,13 @@ #include "streq.h" #include "uniwidth.h" +#ifdef __KLIBC__ +/* To avoid 'conflicting types' error for `__wcwidth' on OS/2 kLIBC. + wchar_t(unsigned short) is defined differently from wint_t(int) on + OS/2 kLIBC. */ +# undef wcwidth +#endif + int wcwidth (wchar_t wc) #undef wcwidth -- 1.8.5.2