diff options
author | Jose <jose@zeroc.com> | 2019-01-11 18:09:22 +0100 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2019-01-11 18:10:30 +0100 |
commit | 6fe6fb0f50e7e1cf64d64c2c8d8d03122fed2eb9 (patch) | |
tree | 21ae24549d02f8fd98d8211949dfdd4ab588d114 /ruby/src | |
parent | Fix whitespace (diff) | |
download | ice-6fe6fb0f50e7e1cf64d64c2c8d8d03122fed2eb9.tar.bz2 ice-6fe6fb0f50e7e1cf64d64c2c8d8d03122fed2eb9.tar.xz ice-6fe6fb0f50e7e1cf64d64c2c8d8d03122fed2eb9.zip |
GCC 8 Build fixes for Python, PHP and Ruby
Diffstat (limited to 'ruby/src')
-rw-r--r-- | ruby/src/IceRuby/Util.h | 74 |
1 files changed, 55 insertions, 19 deletions
diff --git a/ruby/src/IceRuby/Util.h b/ruby/src/IceRuby/Util.h index 324237ef7ed..007abdbecc8 100644 --- a/ruby/src/IceRuby/Util.h +++ b/ruby/src/IceRuby/Util.h @@ -180,7 +180,10 @@ public: RF_0(Fun f) : _f(f) {} inline VALUE operator()() { return _f(); } - static inline VALUE call(RF_0* f) { return (*f)(); } + static inline VALUE call(VALUE f) + { + return (*reinterpret_cast<RF_0*>(f))(); + } private: @@ -192,7 +195,7 @@ inline VALUE callRuby(Fun fun) { typedef RF_0<Fun> RF; RF f(fun); - return callProtected(RubyFunction(RF::call), reinterpret_cast<VALUE>(&f)); + return callProtected(RF::call, reinterpret_cast<VALUE>(&f)); } template<typename Fun, typename T1> @@ -202,7 +205,10 @@ public: RF_1(Fun f, T1 t1) : _f(f), _t1(t1) {} inline VALUE operator()() { return _f(_t1); } - static inline VALUE call(RF_1* f) { return (*f)(); } + static inline VALUE call(VALUE f) + { + return (*reinterpret_cast<RF_1*>(f))(); + } private: @@ -215,7 +221,7 @@ inline VALUE callRuby(Fun fun, T1 t1) { typedef RF_1<Fun, T1> RF; RF f(fun, t1); - return callProtected(RubyFunction(RF::call), reinterpret_cast<VALUE>(&f)); + return callProtected(RF::call, reinterpret_cast<VALUE>(&f)); } template<typename Fun, typename T1, typename T2> @@ -225,7 +231,10 @@ public: RF_2(Fun f, T1 t1, T2 t2) : _f(f), _t1(t1), _t2(t2) {} inline VALUE operator()() { return _f(_t1, _t2); } - static inline VALUE call(RF_2* f) { return (*f)(); } + static inline VALUE call(VALUE f) + { + return (*reinterpret_cast<RF_2*>(f))(); + } private: @@ -239,7 +248,7 @@ inline VALUE callRuby(Fun fun, T1 t1, T2 t2) { typedef RF_2<Fun, T1, T2> RF; RF f(fun, t1, t2); - return callProtected(RubyFunction(RF::call), reinterpret_cast<VALUE>(&f)); + return callProtected(RF::call, reinterpret_cast<VALUE>(&f)); } template<typename Fun, typename T1, typename T2, typename T3> @@ -249,7 +258,10 @@ public: RF_3(Fun f, T1 t1, T2 t2, T3 t3) : _f(f), _t1(t1), _t2(t2), _t3(t3) {} inline VALUE operator()() { return _f(_t1, _t2, _t3); } - static inline VALUE call(RF_3* f) { return (*f)(); } + static inline VALUE call(VALUE f) + { + return (*reinterpret_cast<RF_3*>(f))(); + } private: @@ -264,7 +276,7 @@ inline VALUE callRuby(Fun fun, T1 t1, T2 t2, T3 t3) { typedef RF_3<Fun, T1, T2, T3> RF; RF f(fun, t1, t2, t3); - return callProtected(RubyFunction(RF::call), reinterpret_cast<VALUE>(&f)); + return callProtected(RF::call, reinterpret_cast<VALUE>(&f)); } template<typename Fun, typename T1, typename T2, typename T3, typename T4> @@ -274,7 +286,10 @@ public: RF_4(Fun f, T1 t1, T2 t2, T3 t3, T4 t4) : _f(f), _t1(t1), _t2(t2), _t3(t3), _t4(t4) {} inline VALUE operator()() { return _f(_t1, _t2, _t3, _t4); } - static inline VALUE call(RF_4* f) { return (*f)(); } + static inline VALUE call(VALUE f) + { + return (*reinterpret_cast<RF_4*>(f))(); + } private: @@ -290,7 +305,7 @@ inline VALUE callRuby(Fun fun, T1 t1, T2 t2, T3 t3, T4 t4) { typedef RF_4<Fun, T1, T2, T3, T4> RF; RF f(fun, t1, t2, t3, t4); - return callProtected(RubyFunction(RF::call), reinterpret_cast<VALUE>(&f)); + return callProtected(RF::call, reinterpret_cast<VALUE>(&f)); } // @@ -321,7 +336,12 @@ public: RFV_0(Fun f) : _f(f) {} inline void operator()() { _f(); } - static inline VALUE call(RFV_0* f) { (*f)(); return Qnil; } + + static inline VALUE call(VALUE f) + { + (*reinterpret_cast<RFV_0*>(f))(); + return Qnil; + } private: @@ -333,7 +353,7 @@ inline void callRubyVoid(Fun fun) { typedef RFV_0<Fun> RF; RF f(fun); - callProtected(RubyFunction(RF::call), reinterpret_cast<VALUE>(&f)); + callProtected(RF::call, reinterpret_cast<VALUE>(&f)); } template<typename Fun, typename T1> @@ -343,7 +363,11 @@ public: RFV_1(Fun f, T1 t1) : _f(f), _t1(t1) {} inline void operator()() { _f(_t1); } - static inline VALUE call(RFV_1* f) { (*f)(); return Qnil; } + static inline VALUE call(VALUE f) + { + (*reinterpret_cast<RFV_1*>(f))(); + return Qnil; + } private: @@ -356,7 +380,7 @@ inline void callRubyVoid(Fun fun, T1 t1) { typedef RFV_1<Fun, T1> RF; RF f(fun, t1); - callProtected(RubyFunction(RF::call), reinterpret_cast<VALUE>(&f)); + callProtected(RF::call, reinterpret_cast<VALUE>(&f)); } template<typename Fun, typename T1, typename T2> @@ -366,7 +390,11 @@ public: RFV_2(Fun f, T1 t1, T2 t2) : _f(f), _t1(t1), _t2(t2) {} inline void operator()() { _f(_t1, _t2); } - static inline VALUE call(RFV_2* f) { (*f)(); return Qnil; } + static inline VALUE call(VALUE f) + { + (*reinterpret_cast<RFV_2*>(f))(); + return Qnil; + } private: @@ -380,7 +408,7 @@ inline void callRubyVoid(Fun fun, T1 t1, T2 t2) { typedef RFV_2<Fun, T1, T2> RF; RF f(fun, t1, t2); - callProtected(RubyFunction(RF::call), reinterpret_cast<VALUE>(&f)); + callProtected(RF::call, reinterpret_cast<VALUE>(&f)); } template<typename Fun, typename T1, typename T2, typename T3> @@ -390,7 +418,11 @@ public: RFV_3(Fun f, T1 t1, T2 t2, T3 t3) : _f(f), _t1(t1), _t2(t2), _t3(t3) {} inline void operator()() { _f(_t1, _t2, _t3); } - static inline VALUE call(RFV_3* f) { (*f)(); return Qnil; } + static inline VALUE call(VALUE f) + { + (*reinterpret_cast<RFV_3*>(f))(); + return Qnil; + } private: @@ -405,7 +437,7 @@ inline void callRubyVoid(Fun fun, T1 t1, T2 t2, T3 t3) { typedef RFV_3<Fun, T1, T2, T3> RF; RF f(fun, t1, t2, t3); - callProtected(RubyFunction(RF::call), reinterpret_cast<VALUE>(&f)); + callProtected(RF::call, reinterpret_cast<VALUE>(&f)); } template<typename Fun, typename T1, typename T2, typename T3, typename T4> @@ -415,7 +447,11 @@ public: RFV_4(Fun f, T1 t1, T2 t2, T3 t3, T4 t4) : _f(f), _t1(t1), _t2(t2), _t3(t3), _t4(t4) {} inline void operator()() { _f(_t1, _t2, _t3, _t4); } - static inline VALUE call(RFV_4* f) { (*f)(); return Qnil; } + static inline VALUE call(VALUE f) + { + (*reinterpret_cast<RFV_4*>(f))(); + return Qnil; + } private: |