* ext/iconv/iconv.c (iconv_s_list): support NetBSD/Citrus iconv.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14115 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
360a674fe5
commit
46d6af3a9c
@ -1,3 +1,7 @@
|
|||||||
|
Thu Dec 6 01:00:38 2007 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
|
* ext/iconv/iconv.c (iconv_s_list): support NetBSD/Citrus iconv.
|
||||||
|
|
||||||
Wed Dec 5 16:18:50 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Wed Dec 5 16:18:50 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* proc.c (rb_proc_s_new): call initialize. [ruby-core:13824]
|
* proc.c (rb_proc_s_new): call initialize. [ruby-core:13824]
|
||||||
|
@ -24,6 +24,7 @@ if have_func("iconv", "iconv.h") or
|
|||||||
$defs.push('-DICONV_INPTR_CONST')
|
$defs.push('-DICONV_INPTR_CONST')
|
||||||
end
|
end
|
||||||
have_func("iconvlist", "iconv.h")
|
have_func("iconvlist", "iconv.h")
|
||||||
|
have_func("__iconv_free_list", "iconv.h")
|
||||||
if conf
|
if conf
|
||||||
prefix = '$(srcdir)'
|
prefix = '$(srcdir)'
|
||||||
prefix = $nmake ? "{#{prefix}}" : "#{prefix}/"
|
prefix = $nmake ? "{#{prefix}}" : "#{prefix}/"
|
||||||
|
@ -741,6 +741,24 @@ iconv_s_list(void)
|
|||||||
state = *(int *)args;
|
state = *(int *)args;
|
||||||
if (state) rb_jump_tag(state);
|
if (state) rb_jump_tag(state);
|
||||||
if (args[1]) return args[1];
|
if (args[1]) return args[1];
|
||||||
|
#elif defined(HAVE___ICONV_FREE_LIST)
|
||||||
|
char **list;
|
||||||
|
size_t sz, i;
|
||||||
|
VALUE ary;
|
||||||
|
|
||||||
|
if (__iconv_get_list(&list, &sz)) return Qnil;
|
||||||
|
|
||||||
|
ary = rb_ary_new2(sz);
|
||||||
|
for (i = 0; i < sz; i++) {
|
||||||
|
rb_ary_push(ary, rb_str_new2(list[i]));
|
||||||
|
}
|
||||||
|
__iconv_free_list(list, sz);
|
||||||
|
|
||||||
|
if (!rb_block_given_p())
|
||||||
|
return ary;
|
||||||
|
for (i = 0; i < RARRAY_LEN(ary); i++) {
|
||||||
|
rb_yield(RARRAY_PTR(ary)[i]);
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
rb_notimplement();
|
rb_notimplement();
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user