@@ -454,25 +454,6 @@ struct Invoker<ReturnPolicy, void, Args...> {
454
454
}
455
455
};
456
456
457
- namespace async {
458
-
459
- template <typename F, F f> struct Wrapper ;
460
- template <typename ReturnType, typename ... Args, ReturnType(*f)(Args...)>
461
- struct Wrapper <ReturnType(*)(Args...), f> {
462
- EMSCRIPTEN_KEEPALIVE static ReturnType invoke (Args... args) {
463
- return f (args...);
464
- }
465
- };
466
-
467
- } // end namespace async
468
-
469
- template <typename T, typename ... Policies>
470
- using maybe_wrap_async = typename std::conditional<
471
- isAsync<Policies...>::value,
472
- async::Wrapper<decltype (&T::invoke), &T::invoke>,
473
- T
474
- >::type;
475
-
476
457
template <typename ReturnPolicy, typename FunctorType, typename ReturnType, typename ... Args>
477
458
struct FunctorInvoker {
478
459
static typename internal::BindingType<ReturnType>::WireType invoke (
@@ -601,8 +582,7 @@ void function(const char* name, ReturnType (*fn)(Args...), Policies...) {
601
582
using namespace internal ;
602
583
typename WithPolicies<Policies...>::template ArgTypeList<ReturnType, Args...> args;
603
584
using ReturnPolicy = GetReturnValuePolicy<ReturnType, Policies...>::tag;
604
- using OriginalInvoker = Invoker<ReturnPolicy, ReturnType, Args...>;
605
- auto invoke = &maybe_wrap_async<OriginalInvoker, Policies...>::invoke;
585
+ auto invoke = Invoker<ReturnPolicy, ReturnType, Args...>::invoke;
606
586
_embind_register_function (
607
587
name,
608
588
args.getCount (),
@@ -1469,8 +1449,7 @@ struct RegisterClassMethod<ReturnType (ClassType::*)(Args...)> {
1469
1449
static void invoke (const char * methodName,
1470
1450
ReturnType (ClassType::*memberFunction)(Args...)) {
1471
1451
using ReturnPolicy = GetReturnValuePolicy<ReturnType, Policies...>::tag;
1472
- using OriginalInvoker = MethodInvoker<ReturnPolicy, decltype (memberFunction), ReturnType, ClassType*, Args...>;
1473
- auto invoke = &maybe_wrap_async<OriginalInvoker, Policies...>::invoke;
1452
+ auto invoke = MethodInvoker<ReturnPolicy, decltype (memberFunction), ReturnType, ClassType*, Args...>::invoke;
1474
1453
1475
1454
typename WithPolicies<Policies...>::template ArgTypeList<ReturnType, AllowedRawPointer<ClassType>, Args...> args;
1476
1455
_embind_register_class_function (
@@ -1499,8 +1478,7 @@ struct RegisterClassMethod<ReturnType (ClassType::*)(Args...) const> {
1499
1478
static void invoke (const char * methodName,
1500
1479
ReturnType (ClassType::*memberFunction)(Args...) const ) {
1501
1480
using ReturnPolicy = GetReturnValuePolicy<ReturnType, Policies...>::tag;
1502
- using OriginalInvoker = MethodInvoker<ReturnPolicy, decltype (memberFunction), ReturnType, const ClassType*, Args...>;
1503
- auto invoke = &maybe_wrap_async<OriginalInvoker, Policies...>::invoke;
1481
+ auto invoke = MethodInvoker<ReturnPolicy, decltype (memberFunction), ReturnType, const ClassType*, Args...>::invoke;
1504
1482
1505
1483
typename WithPolicies<Policies...>::template ArgTypeList<ReturnType, AllowedRawPointer<const ClassType>, Args...> args;
1506
1484
_embind_register_class_function (
@@ -1530,8 +1508,7 @@ struct RegisterClassMethod<ReturnType (*)(ThisType, Args...)> {
1530
1508
ReturnType (*function)(ThisType, Args...)) {
1531
1509
typename WithPolicies<Policies...>::template ArgTypeList<ReturnType, ThisType, Args...> args;
1532
1510
using ReturnPolicy = GetReturnValuePolicy<ReturnType, Policies...>::tag;
1533
- using OriginalInvoker = FunctionInvoker<ReturnPolicy, decltype (function), ReturnType, ThisType, Args...>;
1534
- auto invoke = &maybe_wrap_async<OriginalInvoker, Policies...>::invoke;
1511
+ auto invoke = FunctionInvoker<ReturnPolicy, decltype (function), ReturnType, ThisType, Args...>::invoke;
1535
1512
_embind_register_class_function (
1536
1513
TypeID<ClassType>::get (),
1537
1514
methodName,
@@ -1559,8 +1536,7 @@ struct RegisterClassMethod<std::function<ReturnType (ThisType, Args...)>> {
1559
1536
std::function<ReturnType (ThisType, Args...)> function) {
1560
1537
typename WithPolicies<Policies...>::template ArgTypeList<ReturnType, ThisType, Args...> args;
1561
1538
using ReturnPolicy = GetReturnValuePolicy<ReturnType, Policies...>::tag;
1562
- using OriginalInvoker = FunctorInvoker<ReturnPolicy, decltype (function), ReturnType, ThisType, Args...>;
1563
- auto invoke = &maybe_wrap_async<OriginalInvoker, Policies...>::invoke;
1539
+ auto invoke = FunctorInvoker<ReturnPolicy, decltype (function), ReturnType, ThisType, Args...>::invoke;
1564
1540
_embind_register_class_function (
1565
1541
TypeID<ClassType>::get (),
1566
1542
methodName,
@@ -1582,8 +1558,7 @@ struct RegisterClassMethod<ReturnType (ThisType, Args...)> {
1582
1558
Callable& callable) {
1583
1559
typename WithPolicies<Policies...>::template ArgTypeList<ReturnType, ThisType, Args...> args;
1584
1560
using ReturnPolicy = GetReturnValuePolicy<ReturnType, Policies...>::tag;
1585
- using OriginalInvoker = FunctorInvoker<ReturnPolicy, decltype (callable), ReturnType, ThisType, Args...>;
1586
- auto invoke = &maybe_wrap_async<OriginalInvoker, Policies...>::invoke;
1561
+ auto invoke = FunctorInvoker<ReturnPolicy, decltype (callable), ReturnType, ThisType, Args...>::invoke;
1587
1562
_embind_register_class_function (
1588
1563
TypeID<ClassType>::get (),
1589
1564
methodName,
@@ -1866,8 +1841,7 @@ class class_ {
1866
1841
1867
1842
typename WithPolicies<Policies...>::template ArgTypeList<ReturnType, Args...> args;
1868
1843
using ReturnPolicy = GetReturnValuePolicy<ReturnType, Policies...>::tag;
1869
- using OriginalInvoker = internal::Invoker<ReturnPolicy, ReturnType, Args...>;
1870
- auto invoke = &maybe_wrap_async<OriginalInvoker, Policies...>::invoke;
1844
+ auto invoke = internal::Invoker<ReturnPolicy, ReturnType, Args...>::invoke;
1871
1845
_embind_register_class_class_function (
1872
1846
TypeID<ClassType>::get (),
1873
1847
methodName,
0 commit comments