All pastes #22380 Raw Edit

Untitled

public text v1 · immutable
#22380 ·published 2005-09-08 15:48 UTC
rendered paste body
dnl Some implementations make the second argument of iconv non-const for no
dnl sane reason
AC_MSG_CHECKING([whether iconv uses const])
OLDCFLAGS="$CFLAGS"
# This is a gcc-ism but autoconf provides no other way of doing this.
CFLAGS="$CFLAGS -Werror"
AC_COMPILE_IFELSE(AC_LANG_SOURCE(
[#include <iconv.h>
int main()
{ iconv_t i; char *a="a"; size_t s; iconv(i,(const char**)&a,&s,&a,&s); return 0; }
]),
[AC_DEFINE(iconv_arg2_t,[const char **],[Second argument of iconv()])
 AC_MSG_RESULT(yes)],
[AC_DEFINE(iconv_arg2_t,[char **])
 AC_MSG_RESULT(no)])
CFLAGS="$OLDCFLAGS"