From: Richard Jones Date: Wed, 6 May 2009 14:20:15 +0000 (+0100) Subject: RARRAY_LEN macro for Ruby < 1.9. Small strictness fix for OCaml < 3.10. X-Git-Tag: 1.0.19~14 X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=commitdiff_plain;h=9a571d41f56c86e290781492ba410070c34b3379 RARRAY_LEN macro for Ruby < 1.9. Small strictness fix for OCaml < 3.10. --- diff --git a/ruby/ext/guestfs/_guestfs.c b/ruby/ext/guestfs/_guestfs.c index 83486e7..f235c5a 100644 --- a/ruby/ext/guestfs/_guestfs.c +++ b/ruby/ext/guestfs/_guestfs.c @@ -28,6 +28,11 @@ #include "extconf.h" +/* For Ruby < 1.9 */ +#ifndef RARRAY_LEN +#define RARRAY_LEN(r) (RARRAY((r))->len) +#endif + static VALUE m_guestfs; /* guestfs module */ static VALUE c_guestfs; /* guestfs_h handle */ static VALUE e_Error; /* used for all errors */ diff --git a/src/generator.ml b/src/generator.ml index 4c8c2e1..45e8c3f 100755 --- a/src/generator.ml +++ b/src/generator.ml @@ -5676,6 +5676,11 @@ and generate_ruby_c () = #include \"extconf.h\" +/* For Ruby < 1.9 */ +#ifndef RARRAY_LEN +#define RARRAY_LEN(r) (RARRAY((r))->len) +#endif + static VALUE m_guestfs; /* guestfs module */ static VALUE c_guestfs; /* guestfs_h handle */ static VALUE e_Error; /* used for all errors */ @@ -6245,7 +6250,7 @@ Java_com_redhat_et_libguestfs_GuestFS__1close let needs_i = (match fst style with | RStringList _ | RPVList _ | RVGList _ | RLVList _ -> true - | RErr _ | RBool _ | RInt _ | RInt64 _ | RConstString _ + | RErr | RBool _ | RInt _ | RInt64 _ | RConstString _ | RString _ | RIntBool _ | RStat _ | RStatVFS _ | RHashtable _ -> false) || List.exists (function StringList _ -> true | _ -> false) (snd style) in