Commit 7363cd29 by Antonio Maiorano

Reactor: add overload of rr::Call for void(...)

For example, the following would fail to compile because Call tries to return a result: struct Class { static void Foo() { } }; Function<Void()> function; { Call(SomeClass::Foo); Return(); } Bug: b/142132927 Change-Id: I249144aabae1dcfc4cb04a174ae698445be382d2 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/37268 Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarBen Clayton <bclayton@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Tested-by: 's avatarAntonio Maiorano <amaiorano@google.com>
parent 01cc61ab
...@@ -3225,6 +3225,14 @@ namespace rr ...@@ -3225,6 +3225,14 @@ namespace rr
return CallHelper<Return(Arguments...)>::Call(fptr, args...); return CallHelper<Return(Arguments...)>::Call(fptr, args...);
} }
// Calls the function pointer fptr with the given arguments args.
// Overload for calling functions with void return type.
template<typename ... Arguments>
inline void Call(void(fptr)(Arguments...), CToReactor<Arguments>... args)
{
CallHelper<void(Arguments...)>::Call(fptr, args...);
}
// Calls the function pointer fptr with the signature FUNCTION_SIGNATURE and // Calls the function pointer fptr with the signature FUNCTION_SIGNATURE and
// arguments. // arguments.
template<typename FUNCTION_SIGNATURE, typename ... Arguments> template<typename FUNCTION_SIGNATURE, typename ... Arguments>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment