Subject: Re: Questions about iconv.h
To: None <soda@sra.co.jp>
From: T.SHIOZAKI <tshiozak@netbsd.org>
List: tech-userlevel
Date: 10/28/2004 21:21:07
From: SODA Noriyuki <soda@sra.co.jp>
Subject: Re: Questions about iconv.h
Date: Thu, 28 Oct 2004 20:22:52 +0900 (JST)
Message-ID: <200410281122.i9SBMqL21230@srapc342.sra.co.jp>

> >>>>> On Thu, 28 Oct 2004 19:47:07 +0900 (JST),
> 	"T.SHIOZAKI" <tshiozak@netbsd.org> said:
> 
> >> (No idea how to fix / work-around from me.)
> 
> > +/* For throw/catch expression.  (c.f. ISO C++ 15.1/3, 15.3/1, 15.4/1) */
> > +#ifdef __cplusplus
> > +struct __tag_iconv_t {};
> > +#else
> > struct __tag_iconv_t;
> > +#endif
> > typedef struct __tag_iconv_t *iconv_t;
> 
> Isn't it better to fix this in AbiWord side by defining
> UT_iconv_t as something different from iconv_t,
> e.g. struct { iconv_t ic; }, or void *.
>
> It seems the assumption in AbiWord is not portable.
> For example, Solaris 9 uses a pointer to an incomplete struct
> as iconv_t just like NetBSD.

Indeed.


XXX: just (but very dirty) work-around on AbiWord side:

typedef iconv_t UT_iconv_t;
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 200000000
+struct __tag_iconv_t { };  /* XXX: for catch/throw (ISO C++ 15.1)*/
+#endif


--
Takuya SHIOZAKI