Simon Josefsson asked: > > 2) Change the argument type of idna_strerror to 'int'. > > Change the enum from > > > > typedef enum { > > ... > > IDNA_ICONV_ERROR = 9, > > ... > > } Idna_rc; > > > > to > > > > typedef int Idna_rc; > > #ifdef __cplusplus > > /* In C++ we avoid macros. */ > > ... > > const int IDNA_ICONV_ERROR = 9; > > ... > > #else > > ... > > #define IDNA_ICONV_ERROR 9 > > ... > > #endif > > Why is this second part needed?
It is in fact not needed (cf. ISO C99 section 6.7.2.2.(3)). You can also write typedef int Idna_rc; #ifdef __cplusplus ... const int IDNA_ICONV_ERROR = 9; ... #else enum { ... IDNA_ICONV_ERROR = 9, ... }; #endif Bruno -- In memoriam Eduard Brücklmeier <http://en.wikipedia.org/wiki/Eduard_Brücklmeier>