
16 Apr
2011
16 Apr
'11
10:48 p.m.
AMDG On 04/16/2011 03:02 PM, Phil Endecott wrote:
In my own iconv wrapper code I need a const_cast because the POSIX spec misses a const on the second argument to iconv(); some platforms correct this, but not all:
#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__sun__) // Previously __APPLE__ was included in this list; presumably they have // changed their headers. If you have an older system you may need to put // it back. #define ICONV_ARG2_IS_CONST #endif
This doesn't seem to be done here.
Actually, the library handles it in a smarter way: it uses overload resolution to detect the type of ::iconv and adds the cast if needed. In Christ, Steven Watanabe