Skip to content

Commit

Permalink
Added support for VS 12 compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
AdUki committed May 31, 2014
1 parent b121f44 commit 4b86199
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion include/LuaFunctor.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ namespace lua {
///
/// @param luaState Pointer of Lua state
int call(lua_State* luaState) {
traits::apply(function, stack::get_and_pop<Args...>(luaState, nullptr, 2));
traits::apply_no_ret(function, stack::get_and_pop<Args...>(luaState, nullptr, 2));
return 0;
}
};
Expand Down
1 change: 0 additions & 1 deletion include/LuaStack.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ namespace lua { namespace stack {
return sizeof...(Args);
}

template<>
inline int push(lua_State* luaState) { return 0; }

template<>
Expand Down
4 changes: 2 additions & 2 deletions include/Traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ namespace lua { namespace traits {
}

template<class ... Args>
void apply(std::function<void(Args...)> pf, const std::tuple<Args...>& tup)
void apply_no_ret(std::function<void(Args...)> pf, const std::tuple<Args...>& tup)
{
apply_helper(pf, typename make_indexes<Args...>::type(), std::tuple<Args...>(tup));
}

template<class ... Args>
void apply(std::function<void(Args...)> pf, std::tuple<Args...>&& tup)
void apply_no_ret(std::function<void(Args...)> pf, std::tuple<Args...>&& tup)
{
apply_helper(pf, typename make_indexes<Args...>::type(), std::forward<std::tuple<Args...>>(tup));
}
Expand Down
14 changes: 12 additions & 2 deletions test/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,18 @@ void runTest(const std::string& filename)
printf("#####################################\n");
printf("## Running test: %s\n", filename.c_str());
printf("#####################################\n\n");

if (system(std::string("./" + filename).c_str()) == 0)

// TODO: search for executables

#ifdef WIN32
// NOTE: add your own directory according to project
std::string prefix = "Debug\\";
std::string suffix = ".exe";
#else
std::string prefix = "./";
std::string suffix = "";
#endif
if (system(std::string(prefix + filename + suffix).c_str()) == 0)
printf("Test %s OK...\n\n", filename.c_str());
else {
printf("Test %s FAILED!\n\n", filename.c_str());
Expand Down

0 comments on commit 4b86199

Please sign in to comment.