iconv 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1,5 +1,6 @@
1
1
  *.gem
2
2
  *.rbc
3
+ *.swp
3
4
  .bundle
4
5
  .config
5
6
  .yardoc
@@ -5,9 +5,11 @@ dir_config("iconv")
5
5
  conf = File.exist?(File.join($srcdir, "config.charset"))
6
6
  conf = with_config("config-charset", enable_config("config-charset", conf))
7
7
 
8
+ have_func("rb_enc_get", "ruby/encoding.h")
9
+ have_func("st_lookup", "ruby/st.h")
8
10
  if have_func("iconv", "iconv.h") or
9
11
  have_library("iconv", "iconv", "iconv.h")
10
- check_signedness("size_t")
12
+ check_signedness("size_t") rescue nil
11
13
  if checking_for("const of iconv() 2nd argument") do
12
14
  create_tmpsrc(cpp_include("iconv.h") + "---> iconv(cd,0,0,0,0) <---")
13
15
  src = xpopen(cpp_command("")) {|f|f.read}
@@ -13,12 +13,18 @@
13
13
 
14
14
  **********************************************************************/
15
15
 
16
- #include "ruby/ruby.h"
16
+ #include "ruby.h"
17
17
  #include <errno.h>
18
18
  #include <iconv.h>
19
19
  #include <assert.h>
20
+ #ifdef HAVE_RUBY_ST_H
20
21
  #include "ruby/st.h"
22
+ #else /* assume 1.8 */
23
+ #include "st.h"
24
+ #endif
25
+ #ifdef HAVE_RUBY_ENCODING_H
21
26
  #include "ruby/encoding.h"
27
+ #endif
22
28
 
23
29
  /*
24
30
  * Document-class: Iconv
@@ -932,6 +938,7 @@ iconv_iconv(int argc, VALUE *argv, VALUE self)
932
938
  length = NIL_P(n2) ? -1 : NUM2LONG(n2);
933
939
  }
934
940
  }
941
+ #ifdef HAVE_RUBY_ENCODING_H
935
942
  if (start > 0 || length > 0) {
936
943
  rb_encoding *enc = rb_enc_get(str);
937
944
  const char *s = RSTRING_PTR(str), *e = s + RSTRING_LEN(str);
@@ -943,6 +950,7 @@ iconv_iconv(int argc, VALUE *argv, VALUE self)
943
950
  length = rb_enc_nth(ps, e, length, enc) - ps;
944
951
  }
945
952
  }
953
+ #endif
946
954
 
947
955
  return iconv_convert(VALUE2ICONV(cd), str, start, length, ENCODING_GET(self), NULL);
948
956
  }
@@ -1,3 +1,3 @@
1
1
  class Iconv
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iconv
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -26,7 +26,6 @@ files:
26
26
  - README.md
27
27
  - Rakefile
28
28
  - ext/iconv/charset_alias.rb
29
- - ext/iconv/depend
30
29
  - ext/iconv/extconf.rb
31
30
  - ext/iconv/iconv.c
32
31
  - ext/iconv/mkwrapper.rb
@@ -1,2 +0,0 @@
1
- iconv.o: iconv.c $(hdrdir)/ruby.h $(topdir)/config.h $(hdrdir)/defines.h \
2
- $(hdrdir)/st.h $(hdrdir)/intern.h $(hdrdir)/encoding.h