|
From: akira y. <ak...@de...> - 2002-02-16 05:18:54
|
Hello, >>>>> In <200...@se...> >>>>> LaMont Jones <la...@hp...> wrote: > > It's a bug in the Ruby headers. It needs a fix in Ruby which has been > > done in the Ruby development branch (Ruby 1.7.something) but not in > > the current release (or at least not the one in Woody. I don't know > > which version of Ruby you have in... wait, what was the name of the > > character now? Well, unstable anyway) > > It also needs a minor fix in SWIG which has been done in CVS but > > wasn't released either. > > > > The bottom line is, we're out in the cold :( > > Architectures with gcc 3.0.x are ruled out for the time being. > > ruby_1.6.6-5 is in sid (which will always be unstable) > > Depending on how invasive the fix is, I suppose the ruby maintainer > could port the fix back to ruby 1.6.6-5, and thereby fix all these > ruby-dependants. Akira? I made a back-port-patch based on results of diffs between 2001-03-27 and 2001-05-03 on *.h, and I attach the patch in this mail. How do you think about it? If it is O.K., I will make a new deb-package. (and will send it to Mr.Matz if it is better to do it by me.) Thank you. -- akira yamada <URL:http://arika.org/ruby/> (ak...@ar..., ak...@ru... or ak...@li...) Index: intern.h =================================================================== RCS file: /home/akira/cvs/ruby-src/cvs/ruby/intern.h,v retrieving revision 1.35.2.16 diff -u -r1.35.2.16 intern.h --- intern.h 13 Feb 2002 09:02:15 -0000 1.35.2.16 +++ intern.h 16 Feb 2002 04:42:15 -0000 @@ -95,13 +95,13 @@ VALUE rb_class_protected_instance_methods _((int, VALUE*, VALUE)); VALUE rb_class_private_instance_methods _((int, VALUE*, VALUE)); VALUE rb_obj_singleton_methods _((VALUE)); -void rb_define_method_id _((VALUE, ID, VALUE (*)(), int)); +void rb_define_method_id _((VALUE, ID, VALUE (*)(ANYARGS), int)); void rb_frozen_class_p _((VALUE)); void rb_undef _((VALUE, ID)); -void rb_define_protected_method _((VALUE, const char*, VALUE (*)(), int)); -void rb_define_private_method _((VALUE, const char*, VALUE (*)(), int)); -void rb_define_singleton_method _((VALUE,const char*,VALUE(*)(),int)); -void rb_define_private_method _((VALUE,const char*,VALUE(*)(),int)); +void rb_define_protected_method _((VALUE, const char*, VALUE (*)(ANYARGS), int)); +void rb_define_private_method _((VALUE, const char*, VALUE (*)(ANYARGS), int)); +void rb_define_singleton_method _((VALUE,const char*,VALUE(*)(ANYARGS),int)); +void rb_define_private_method _((VALUE,const char*,VALUE(*)(ANYARGS),int)); VALUE rb_singleton_class _((VALUE)); /* enum.c */ VALUE rb_enum_length _((VALUE)); @@ -167,13 +167,13 @@ VALUE rb_thread_stop _((void)); VALUE rb_thread_wakeup _((VALUE)); VALUE rb_thread_run _((VALUE)); -VALUE rb_thread_create _((VALUE (*)(), void*)); +VALUE rb_thread_create _((VALUE (*)(ANYARGS), void*)); int rb_thread_scope_shared_p _((void)); void rb_thread_interrupt _((void)); void rb_thread_trap_eval _((VALUE, int)); void rb_thread_signal_raise _((char*)); -int rb_thread_select(); -void rb_thread_wait_for(); +int rb_thread_select(ANYARGS); +void rb_thread_wait_for(ANYARGS); VALUE rb_thread_current _((void)); VALUE rb_thread_main _((void)); VALUE rb_thread_local_aref _((VALUE, ID)); @@ -347,7 +347,7 @@ VALUE rb_struct_aset _((VALUE, VALUE, VALUE)); VALUE rb_struct_getmember _((VALUE, ID)); /* time.c */ -VALUE rb_time_new(); +VALUE rb_time_new(ANYARGS); /* variable.c */ VALUE rb_mod_name _((VALUE)); VALUE rb_class_path _((VALUE)); Index: node.h =================================================================== RCS file: /home/akira/cvs/ruby-src/cvs/ruby/node.h,v retrieving revision 1.18.2.2 diff -u -r1.18.2.2 node.h --- node.h 6 Apr 2001 05:42:40 -0000 1.18.2.2 +++ node.h 16 Feb 2002 04:43:03 -0000 @@ -131,7 +131,7 @@ struct RNode *node; ID id; VALUE value; - VALUE (*cfunc)(); + VALUE (*cfunc)(ANYARGS); ID *tbl; } u1; union { @@ -340,7 +340,7 @@ NODE *rb_compile_file _((const char*, VALUE, int)); void rb_add_method _((VALUE, ID, NODE *, int)); -NODE *rb_node_newnode(); +NODE *rb_node_newnode(ANYARGS); struct global_entry *rb_global_entry _((ID)); VALUE rb_gvar_get _((struct global_entry *)); Index: ruby.h =================================================================== RCS file: /home/akira/cvs/ruby-src/cvs/ruby/ruby.h,v retrieving revision 1.29.2.10 diff -u -r1.29.2.10 ruby.h --- ruby.h 25 Dec 2001 15:09:05 -0000 1.29.2.10 +++ ruby.h 16 Feb 2002 04:27:48 -0000 @@ -74,6 +74,12 @@ # define __(args) () #endif +#ifdef __cplusplus +#define ANYARGS ... +#else +#define ANYARGS +#endif + #ifdef HAVE_ATTR_NORETURN # define NORETURN __attribute__ ((noreturn)) #else @@ -408,8 +414,8 @@ #define MEMMOVE(p1,p2,type,n) memmove((p1), (p2), sizeof(type)*(n)) #define MEMCMP(p1,p2,type,n) memcmp((p1), (p2), sizeof(type)*(n)) -void rb_glob _((char*,void(*)(),VALUE)); -void rb_globi _((char*,void(*)(),VALUE)); +void rb_glob _((char*,void(*)(const char*,VALUE),VALUE)); +void rb_iglob _((char*,void(*)(const char*,VALUE),VALUE)); VALUE rb_define_class _((const char*,VALUE)); VALUE rb_define_module _((const char*)); @@ -420,16 +426,16 @@ void rb_extend_object _((VALUE,VALUE)); void rb_define_variable _((const char*,VALUE*)); -void rb_define_virtual_variable _((const char*,VALUE(*)(),void(*)())); -void rb_define_hooked_variable _((const char*,VALUE*,VALUE(*)(),void(*)())); +void rb_define_virtual_variable _((const char*,VALUE(*)(ANYARGS),void(*)(ANYARGS))); +void rb_define_hooked_variable _((const char*,VALUE*,VALUE(*)(ANYARGS),void(*)(ANYARGS))); void rb_define_readonly_variable _((const char*,VALUE*)); void rb_define_const _((VALUE,const char*,VALUE)); void rb_define_global_const _((const char*,VALUE)); -#define RUBY_METHOD_FUNC(func) ((VALUE (*)__((...)))func) -void rb_define_method _((VALUE,const char*,VALUE(*)(),int)); -void rb_define_module_function _((VALUE,const char*,VALUE(*)(),int)); -void rb_define_global_function _((const char*,VALUE(*)(),int)); +#define RUBY_METHOD_FUNC(func) ((VALUE (*)(ANYARGS))func) +void rb_define_method _((VALUE,const char*,VALUE(*)(ANYARGS),int)); +void rb_define_module_function _((VALUE,const char*,VALUE(*)(ANYARGS),int)); +void rb_define_global_function _((const char*,VALUE(*)(ANYARGS),int)); void rb_undef_method _((VALUE,const char*)); void rb_define_alias _((VALUE,const char*,const char*)); @@ -479,11 +485,11 @@ VALUE rb_each _((VALUE)); VALUE rb_yield _((VALUE)); int rb_block_given_p _((void)); -VALUE rb_iterate _((VALUE(*)(),VALUE,VALUE(*)(),VALUE)); -VALUE rb_rescue _((VALUE(*)(),VALUE,VALUE(*)(),VALUE)); -VALUE rb_rescue2 __((VALUE(*)(),VALUE,VALUE(*)(),VALUE,...)); -VALUE rb_ensure _((VALUE(*)(),VALUE,VALUE(*)(),VALUE)); -VALUE rb_catch _((const char*,VALUE(*)(),VALUE)); +VALUE rb_iterate _((VALUE(*)(ANYARGS),VALUE,VALUE(*)(ANYARGS),VALUE)); +VALUE rb_rescue _((VALUE(*)(ANYARGS),VALUE,VALUE(*)(ANYARGS),VALUE)); +VALUE rb_rescue2 __((VALUE(*)(ANYARGS),VALUE,VALUE(*)(ANYARGS),VALUE,...)); +VALUE rb_ensure _((VALUE(*)(ANYARGS),VALUE,VALUE(*)(ANYARGS),VALUE)); +VALUE rb_catch _((const char*,VALUE(*)(ANYARGS),VALUE)); void rb_throw _((const char*,VALUE)) NORETURN; VALUE rb_require _((const char*)); Index: rubysig.h =================================================================== RCS file: /home/akira/cvs/ruby-src/cvs/ruby/rubysig.h,v retrieving revision 1.6 diff -u -r1.6 rubysig.h --- rubysig.h 16 Nov 2000 07:24:11 -0000 1.6 +++ rubysig.h 16 Feb 2002 04:43:34 -0000 @@ -57,7 +57,7 @@ #define ALLOW_INTS {rb_prohibit_interrupt--; CHECK_INTS;} #define ENABLE_INTS {rb_prohibit_interrupt--;} -VALUE rb_with_disable_interrupt _((VALUE(*)(),VALUE)); +VALUE rb_with_disable_interrupt _((VALUE(*)(ANYARGS),VALUE)); EXTERN rb_atomic_t rb_trap_pending; void rb_trap_restore_mask _((void)); |