#!/usr/bin/env bash

F=.tst_check_iconv_const_char.cpp
cat > $F <<EOF

#include <iconv.h>

void f() {
    iconv_t converter;
    const char* inbuf;
    char* outbuf;
    size_t n_in;
    size_t n_out;
    iconv(converter, &inbuf, &n_in, &outbuf, &n_out);
}
EOF


if g++ -c $F 2>/dev/null; then
    # We can use const char* for the input buffer
    echo "-DHAVE_ICONV_CONST_CHAR=1 "
else
    echo ""
fi
