Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
ICONV.cpp
Go to the documentation of this file.
1// checking for iconv() in <iconv.h>
2
3
25#include <iconv.h>
26#include <stddef.h>
27
28extern "C" {
29
30typedef size_t (f_i_cppc)(iconv_t, const char**, size_t*, char**, size_t*);
31typedef size_t (f_i_cpp) (iconv_t, char**, size_t*, char**, size_t*);
32
33}
34
35
36const char* foo (f_i_cppc*) { return "const char**"; }
37const char* foo (f_i_cpp*) { return "char**"; }
38
39
40const char* bar ()
41{
42 return foo (&iconv);
43}
44
45
46// include last so as not to pollute the global namespace
47// and skew the result of the test
48#include <stdio.h>
49
50
51int main ()
52{
53 const char *argtype = bar ();
54
55 if ('o' == argtype [1]) {
56 // iconv() second argument type is const char**
57 printf ("// ");
58 }
59
60 // may be commented out in the printf statement above
61 printf ("#define _RWSTD_NO_ICONV_CONST_CHAR\n");
62
63 printf ("#define _RWSTD_ICONV_ARG2_T %s\n", argtype);
64
65 return 0;
66}
IMPORT_C SInt32 printf(const Char *,...)
const char * bar()
Definition ICONV.cpp:40
size_t() f_i_cpp(iconv_t, char **, size_t *, char **, size_t *)
Definition ICONV.cpp:31
size_t() f_i_cppc(iconv_t, const char **, size_t *, char **, size_t *)
Definition ICONV.cpp:30
int main()
Definition ICONV.cpp:51
#define foo(buf, s,...)