Skip to content

Commit

Permalink
Add support for long long.
Browse files Browse the repository at this point in the history
Fixes tests on MSVC x64, where lua_Integer == ptrdiff_t == long long.
  • Loading branch information
Oberon00 committed Jul 10, 2013
1 parent b7f97d6 commit c9582ce
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions luabind/detail/policy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -754,17 +754,26 @@ struct default_converter<type const&> \

#endif

// TODO: The preprocessor does not have access to enough information to
// relieably determine which of lua_tointeger or lua_tonumber would be better.
// Convert to using template metaprogramming (could use boost::is_arithmetic).

LUABIND_NUMBER_CONVERTER(char, integer)
LUABIND_NUMBER_CONVERTER(signed char, integer)
LUABIND_NUMBER_CONVERTER(unsigned char, integer)
LUABIND_NUMBER_CONVERTER(signed short, integer)
LUABIND_NUMBER_CONVERTER(unsigned short, integer)
LUABIND_NUMBER_CONVERTER(signed int, integer)

LUABIND_NUMBER_CONVERTER(signed int, integer)
LUABIND_NUMBER_CONVERTER(unsigned int, number)
LUABIND_NUMBER_CONVERTER(unsigned long, number)

LUABIND_NUMBER_CONVERTER(signed long, integer)

#ifndef BOOST_NO_LONG_LONG
LUABIND_NUMBER_CONVERTER(signed long long, number)
LUABIND_NUMBER_CONVERTER(unsigned long long, number)
#endif

LUABIND_NUMBER_CONVERTER(float, number)
LUABIND_NUMBER_CONVERTER(double, number)
LUABIND_NUMBER_CONVERTER(long double, number)
Expand Down

0 comments on commit c9582ce

Please sign in to comment.