From 5172e595c90357ff0d66dbda52e58baeaa394336 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 30 Jul 2003 01:31:43 +0000 Subject: * ext/iconv/iconv.c (iconv_convert): append unchanged portion after overflow. [ruby-dev:21006] * ext/iconv/extconf.rb: check if iconv() 2nd argument is const. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4223 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/iconv/extconf.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'ext/iconv/extconf.rb') diff --git a/ext/iconv/extconf.rb b/ext/iconv/extconf.rb index b81b7379fc..7176fa45e3 100644 --- a/ext/iconv/extconf.rb +++ b/ext/iconv/extconf.rb @@ -6,6 +6,20 @@ conf = File.exist?(File.join($srcdir, "config.charset")) conf = with_config("config-charset", enable_config("config-charset", conf)) if have_header("iconv.h") + if !try_compile("", "-Werror") or checking_for("iconv() 2nd argument is const") do + !try_compile(' +#include +size_t +test(iconv_t cd, char **inptr, size_t *inlen, char **outptr, size_t *outlen) +{ + return iconv(cd, inptr, inlen, outptr, outlen); +} +', "-Werror") + end + $defs.push('-DICONV_INPTR_CAST=""') + else + $defs.push('-DICONV_INPTR_CAST="(char **)"') + end have_library("iconv") if conf prefix = '$(srcdir)' -- cgit v1.2.3