Skip to content

Commit 6efbc51

Browse files
Zegerieagleivg
authored andcommitted
xrGame: Resolve mixed_delegate::bind's ambiguous type for luabind
1 parent 71da06b commit 6efbc51

File tree

6 files changed

+40
-42
lines changed

6 files changed

+40
-42
lines changed

src/xrGame/account_manager_script.cpp

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -30,40 +30,42 @@ SCRIPT_EXPORT(account_manager, (), {
3030
.def("stop_searching_email", &account_manager::stop_searching_email)];
3131
});
3232

33-
#ifndef LINUX // FIXME!!!
3433
SCRIPT_EXPORT(suggest_nicks_cb, (), {
35-
module(luaState)[class_<gamespy_gp::suggest_nicks_cb>("suggest_nicks_cb")
34+
using namespace gamespy_gp;
35+
module(luaState)[class_<suggest_nicks_cb>("suggest_nicks_cb")
3636
.def(constructor<>())
37-
.def(constructor<gamespy_gp::suggest_nicks_cb::lua_object_type,
38-
gamespy_gp::suggest_nicks_cb::lua_function_type>())
39-
.def("bind", &gamespy_gp::suggest_nicks_cb::bind)
40-
.def("clear", &gamespy_gp::suggest_nicks_cb::clear)];
37+
.def(constructor<suggest_nicks_cb::lua_object_type,
38+
suggest_nicks_cb::lua_function_type>())
39+
.def("bind", (suggest_nicks_cb::lua_bind_type)(&suggest_nicks_cb::bind))
40+
.def("clear", &suggest_nicks_cb::clear)];
4141
});
4242

4343
SCRIPT_EXPORT(account_operation_cb, (), {
44-
module(luaState)[class_<gamespy_gp::account_operation_cb>("account_operation_cb")
44+
using namespace gamespy_gp;
45+
module(luaState)[class_<account_operation_cb>("account_operation_cb")
4546
.def(constructor<>())
46-
.def(constructor<gamespy_gp::account_operation_cb::lua_object_type,
47-
gamespy_gp::account_operation_cb::lua_function_type>())
48-
.def("bind", &gamespy_gp::account_operation_cb::bind)
49-
.def("clear", &gamespy_gp::account_operation_cb::clear)];
47+
.def(constructor<account_operation_cb::lua_object_type,
48+
account_operation_cb::lua_function_type>())
49+
.def("bind", (account_operation_cb::lua_bind_type)(&account_operation_cb::bind))
50+
.def("clear", &account_operation_cb::clear)];
5051
});
5152

5253
SCRIPT_EXPORT(account_profiles_cb, (), {
53-
module(luaState)[class_<gamespy_gp::account_profiles_cb>("account_profiles_cb")
54+
using namespace gamespy_gp;
55+
module(luaState)[class_<account_profiles_cb>("account_profiles_cb")
5456
.def(constructor<>())
55-
.def(constructor<gamespy_gp::account_profiles_cb::lua_object_type,
56-
gamespy_gp::account_profiles_cb::lua_function_type>())
57-
.def("bind", &gamespy_gp::account_profiles_cb::bind)
58-
.def("clear", &gamespy_gp::account_profiles_cb::clear)];
57+
.def(constructor<account_profiles_cb::lua_object_type,
58+
account_profiles_cb::lua_function_type>())
59+
.def("bind", (account_profiles_cb::lua_bind_type)(&account_profiles_cb::bind))
60+
.def("clear", &account_profiles_cb::clear)];
5961
});
6062

6163
SCRIPT_EXPORT(found_email_cb, (), {
62-
module(luaState)[class_<gamespy_gp::found_email_cb>("found_email_cb")
64+
using namespace gamespy_gp;
65+
module(luaState)[class_<found_email_cb>("found_email_cb")
6366
.def(constructor<>())
64-
.def(constructor<gamespy_gp::found_email_cb::lua_object_type,
65-
gamespy_gp::found_email_cb::lua_function_type>())
66-
.def("bind", &gamespy_gp::found_email_cb::bind)
67-
.def("clear", &gamespy_gp::found_email_cb::clear)];
67+
.def(constructor<found_email_cb::lua_object_type,
68+
found_email_cb::lua_function_type>())
69+
.def("bind", (found_email_cb::lua_bind_type)(&found_email_cb::bind))
70+
.def("clear", &found_email_cb::clear)];
6871
});
69-
#endif

src/xrGame/login_manager_script.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,12 @@ SCRIPT_EXPORT(profile, (), {
3232
luaState)[class_<profile>("profile").def("unique_nick", &profile::unique_nick).def("online", &profile::online)];
3333
});
3434

35-
#ifndef LINUX // FIXME!!!
3635
SCRIPT_EXPORT(login_operation_cb, (), {
37-
module(luaState)[class_<gamespy_gp::login_operation_cb>("login_operation_cb")
36+
using namespace gamespy_gp;
37+
module(luaState)[class_<login_operation_cb>("login_operation_cb")
3838
.def(constructor<>())
39-
.def(constructor<gamespy_gp::login_operation_cb::lua_object_type,
40-
gamespy_gp::login_operation_cb::lua_function_type>())
41-
.def("bind", &gamespy_gp::login_operation_cb::bind)
42-
.def("clear", &gamespy_gp::login_operation_cb::clear)];
39+
.def(constructor<login_operation_cb::lua_object_type,
40+
login_operation_cb::lua_function_type>())
41+
.def("bind", (login_operation_cb::lua_bind_type)(&login_operation_cb::bind))
42+
.def("clear", &login_operation_cb::clear)];
4343
});
44-
#endif

src/xrGame/mixed_delegate.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@ class mixed_delegate<R(Param1, Param2), UniqueTag>
1717
typedef R return_type;
1818
typedef Param1 param1_type;
1919
typedef Param2 param2_type;
20+
typedef mixed_delegate<R(Param1, Param2), UniqueTag> self_type;
2021

2122
typedef fastdelegate::FastDelegate<R(Param1, Param2)> fastdelegate_type;
2223
typedef CScriptCallbackEx<R> lua_delegate_type;
2324
typedef luabind::object lua_object_type;
2425
typedef luabind::functor<R> lua_function_type;
26+
using lua_bind_type = void (self_type::*)(lua_object_type, lua_function_type);
2527

2628
mixed_delegate() {}
2729
~mixed_delegate() {}

src/xrGame/profile_data_types_script.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,12 @@ SCRIPT_EXPORT(profile_data_script_registrator, (), {
2020
.def_readonly("second", &all_best_scores_t::value_type::second)];
2121
});
2222

23-
#ifndef LINUX // FIXME!!!
2423
SCRIPT_EXPORT(store_operation_cb, (), {
25-
module(luaState)[class_<gamespy_profile::store_operation_cb>("store_operation_cb")
24+
using namespace gamespy_profile;
25+
module(luaState)[class_<store_operation_cb>("store_operation_cb")
2626
.def(constructor<>())
27-
.def(constructor<gamespy_profile::store_operation_cb::lua_object_type,
28-
gamespy_profile::store_operation_cb::lua_function_type>())
29-
.def("bind", &gamespy_profile::store_operation_cb::bind)
30-
.def("clear", &gamespy_profile::store_operation_cb::clear)];
27+
.def(constructor<store_operation_cb::lua_object_type,
28+
store_operation_cb::lua_function_type>())
29+
.def("bind", (store_operation_cb::lua_bind_type)(&store_operation_cb::bind))
30+
.def("clear", &store_operation_cb::clear)];
3131
});
32-
#endif

src/xrGame/ui/UIListBox_script.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,13 @@ SCRIPT_EXPORT(SServerFilters, (), {
6464
.def_readwrite("listen_servers", &SServerFilters::listen_servers)];
6565
});
6666

67-
#ifndef LINUX // FIXME!!!
6867
SCRIPT_EXPORT(connect_error_cb, (), {
6968
module(luaState)[class_<connect_error_cb>("connect_error_cb")
7069
.def(constructor<>())
7170
.def(constructor<connect_error_cb::lua_object_type, connect_error_cb::lua_function_type>())
72-
.def("bind", &connect_error_cb::bind)
71+
.def("bind", (connect_error_cb::lua_bind_type)(&connect_error_cb::bind))
7372
.def("clear", &connect_error_cb::clear)];
7473
});
75-
#endif
7674

7775
SCRIPT_EXPORT(CServerList, (CUIWindow), {
7876
module(luaState)[class_<CServerList, CUIWindow>("CServerList")

src/xrGame/ui/UIWindow_script.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,18 +81,16 @@ SCRIPT_EXPORT(SServerFilters, (), {
8181
];
8282
});
8383

84-
#ifndef LINUX // FIXME!!!
8584
SCRIPT_EXPORT(connect_error_cb, (), {
8685
module(luaState)
8786
[
8887
class_<connect_error_cb>("connect_error_cb")
8988
.def(constructor<>())
9089
.def(constructor<connect_error_cb::lua_object_type, connect_error_cb::lua_function_type>())
91-
.def("bind", &connect_error_cb::bind)
90+
.def("bind", (connect_error_cb::lua_bind_type)(&connect_error_cb::bind))
9291
.def("clear", &connect_error_cb::clear)
9392
];
9493
});
95-
#endif
9694

9795
SCRIPT_EXPORT(CServerList, (CUIWindow), {
9896
module(luaState)

0 commit comments

Comments
 (0)