diff --git a/Lib/ruby/rubyclasses.swg b/Lib/ruby/rubyclasses.swg index c031a4514..19ffe3d7f 100644 --- a/Lib/ruby/rubyclasses.swg +++ b/Lib/ruby/rubyclasses.swg @@ -84,7 +84,6 @@ namespace swig { protected: VALUE _obj; - static ID cmp_id; static ID hash_id; static ID lt_id; static ID gt_id; @@ -177,9 +176,10 @@ namespace swig { } -#define GC_VALUE_CMP( op_id, op, cmp ) \ +#define GC_VALUE_CMP( op_id, op, cmp, cmpval ) \ bool op( const GC_VALUE& other ) const \ { \ + bool res = false; \ VALUE ret = Qnil; \ SWIG_RUBY_THREAD_BEGIN_BLOCK; \ if ( rb_respond_to( _obj, op_id ) == Qtrue ) \ @@ -193,7 +193,6 @@ namespace swig { ret = rb_protect( PROTECTFUNC(swig_protect_funcall), VALUE(&args), \ &status ); \ } \ - bool res = false; \ if ( ret == Qnil ) { \ VALUE a = rb_funcall( _obj, hash_id, 0 ); \ VALUE b = rb_funcall( VALUE(other), hash_id, 0 ); \ @@ -208,11 +207,11 @@ namespace swig { } - GC_VALUE_CMP( eq_id, operator==, == ) - GC_VALUE_CMP( lt_id, operator<, < ) - GC_VALUE_CMP( le_id, operator<=, <= ) - GC_VALUE_CMP( gt_id, operator>, > ) - GC_VALUE_CMP( ge_id, operator>=, >= ) + GC_VALUE_CMP( eq_id, operator==, ==, == 0 ) + GC_VALUE_CMP( lt_id, operator<, < , < 0 ) + GC_VALUE_CMP( le_id, operator<=, <=, <= 0 ) + GC_VALUE_CMP( gt_id, operator>, > , > 0 ) + GC_VALUE_CMP( ge_id, operator>=, >=, >= 0 ) #undef GC_VALUE_CMP bool operator!=( const GC_VALUE& other ) @@ -275,7 +274,6 @@ namespace swig { }; - ID GC_VALUE::cmp_id = rb_intern("<=>"); ID GC_VALUE::hash_id = rb_intern("hash"); ID GC_VALUE::lt_id = rb_intern("<"); ID GC_VALUE::gt_id = rb_intern(">"); diff --git a/Lib/std/std_multiset.i b/Lib/std/std_multiset.i index bdb2a506b..98a7fb9d7 100644 --- a/Lib/std/std_multiset.i +++ b/Lib/std/std_multiset.i @@ -63,7 +63,7 @@ namespace std { template <> struct traits > { typedef pointer_category category; static const char* type_name() { - return "std::multiset<" #_Key "," #_Alloc " >"; + return "std::multiset<" #_Key "," #_Compare "," #_Alloc " >"; } }; } diff --git a/Lib/std/std_queue.i b/Lib/std/std_queue.i index 41c6fc8f6..42273eee6 100644 --- a/Lib/std/std_queue.i +++ b/Lib/std/std_queue.i @@ -75,7 +75,7 @@ namespace std { template <> struct traits > { typedef pointer_category category; static const char* type_name() { - return "std::queue<" #_Tp " >"; + return "std::queue<" #_Tp "," #_Sequence " >"; } }; } @@ -109,7 +109,7 @@ namespace std { template <> struct traits > { typedef value_category category; static const char* type_name() { - return "std::queue<" #_Tp " * >"; + return "std::queue<" #_Tp "," #_Sequence " * >"; } }; } diff --git a/Lib/std/std_stack.i b/Lib/std/std_stack.i index 7ea78c187..fb900a57c 100644 --- a/Lib/std/std_stack.i +++ b/Lib/std/std_stack.i @@ -74,7 +74,7 @@ namespace std { template <> struct traits > { typedef pointer_category category; static const char* type_name() { - return "std::stack<" #_Tp " >"; + return "std::stack<" #_Tp "," #_Sequence " >"; } }; } @@ -108,7 +108,7 @@ namespace std { template <> struct traits > { typedef value_category category; static const char* type_name() { - return "std::stack<" #_Tp " * >"; + return "std::stack<" #_Tp "," #_Sequence " * >"; } }; }