|
|
|
@ -176,7 +176,7 @@ inline OutputClass horrible_cast(const InputClass input){
@@ -176,7 +176,7 @@ inline OutputClass horrible_cast(const InputClass input){
|
|
|
|
|
// If the compile fails here, it means the compiler has peculiar
|
|
|
|
|
// unions which would prevent the cast from working.
|
|
|
|
|
typedef int ERROR_CantUseHorrible_cast[sizeof(InputClass)==sizeof(u)
|
|
|
|
|
&& sizeof(InputClass)==sizeof(OutputClass) ? 1 : -1]; |
|
|
|
|
&& sizeof(InputClass)==sizeof(OutputClass) ? 1 : -1] __attribute((unused)); |
|
|
|
|
u.in = input; |
|
|
|
|
return u.out; |
|
|
|
|
} |
|
|
|
@ -292,7 +292,7 @@ struct SimplifyMemFunc {
@@ -292,7 +292,7 @@ struct SimplifyMemFunc {
|
|
|
|
|
GenericMemFuncType &bound_func) {
|
|
|
|
|
// Unsupported member function type -- force a compile failure.
|
|
|
|
|
// (it's illegal to have a array with negative size).
|
|
|
|
|
typedef char ERROR_Unsupported_member_function_pointer_on_this_compiler[N-100]; |
|
|
|
|
typedef char ERROR_Unsupported_member_function_pointer_on_this_compiler[N-100] __attribute((unused)); |
|
|
|
|
return 0;
|
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
@ -778,7 +778,7 @@ public:
@@ -778,7 +778,7 @@ public:
|
|
|
|
|
// Ensure that there's a compilation failure if function pointers
|
|
|
|
|
// and data pointers have different sizes.
|
|
|
|
|
// If you get this error, you need to #undef FASTDELEGATE_USESTATICFUNCTIONHACK.
|
|
|
|
|
typedef int ERROR_CantUseEvilMethod[sizeof(GenericClass *)==sizeof(function_to_bind) ? 1 : -1]; |
|
|
|
|
typedef int ERROR_CantUseEvilMethod[sizeof(GenericClass *)==sizeof(function_to_bind) ? 1 : -1] __attribute((unused)); |
|
|
|
|
m_pthis = horrible_cast<GenericClass *>(function_to_bind); |
|
|
|
|
// MSVC, SunC++ and DMC accept the following (non-standard) code:
|
|
|
|
|
// m_pthis = static_cast<GenericClass *>(static_cast<void *>(function_to_bind));
|
|
|
|
@ -793,7 +793,7 @@ public:
@@ -793,7 +793,7 @@ public:
|
|
|
|
|
// Ensure that there's a compilation failure if function pointers
|
|
|
|
|
// and data pointers have different sizes.
|
|
|
|
|
// If you get this error, you need to #undef FASTDELEGATE_USESTATICFUNCTIONHACK.
|
|
|
|
|
typedef int ERROR_CantUseEvilMethod[sizeof(UnvoidStaticFuncPtr)==sizeof(this) ? 1 : -1]; |
|
|
|
|
typedef int ERROR_CantUseEvilMethod[sizeof(UnvoidStaticFuncPtr)==sizeof(this) ? 1 : -1] __attribute((unused)); |
|
|
|
|
return horrible_cast<UnvoidStaticFuncPtr>(this); |
|
|
|
|
} |
|
|
|
|
#endif // !defined(FASTDELEGATE_USESTATICFUNCTIONHACK)
|
|
|
|
|