sheepy

build system (sheepy) and package manager (spm) for C
git clone https://spartatek.se/git/sheepy.git
Log | Files | Refs | README | LICENSE

iconv-argument-types.h (1168B)


      1 #ifndef __QUEX_INCLUDE_GUARD__COMPATIBILITY__ICONV_ARGUMENT_TYPES_H
      2 #define __QUEX_INCLUDE_GUARD__COMPATIBILITY__ICONV_ARGUMENT_TYPES_H
      3 
      4 
      5 #if ! defined (__QUEX_OPTION_PLAIN_C)
      6     /* NOTE: At the time of this writing 'iconv' is delivered on different 
      7      *       systems with different definitions for the second argument. The 
      8      *       following 'hack' by Howard Jeng does the adaption automatically. */
      9     struct __Adapter_FuncIconv_SecondArgument {
     10         __Adapter_FuncIconv_SecondArgument(uint8_t ** in) : data(in) {}
     11         uint8_t ** data;
     12         operator const char **(void) const { return (const char **)(data); }
     13         operator       char **(void) const { return (      char **)(data); }
     14     }; 
     15 
     16 #   define __QUEX_ADAPTER_ICONV_2ND_ARG(ARG) (__Adapter_FuncIconv_SecondArgument(ARG))
     17 
     18 #else
     19     /* For 'C' things do not work out that elegantly ... */
     20 #   if defined(QUEX_SETTING_ICONV_2ND_ARG_CONST_CHARPP)
     21 #       define __QUEX_ADAPTER_ICONV_2ND_ARG(ARG)  ((const char**)(ARG))
     22 #   else
     23 #       define __QUEX_ADAPTER_ICONV_2ND_ARG(ARG)  ((char**)(ARG))
     24 #   endif
     25 
     26 #endif
     27 
     28 #endif /* __QUEX_INCLUDE_GUARD__COMPATIBILITY__ICONV_ARGUMENT_TYPES_H */