From bbd8bb0eabe2788a4f3edb4e848e189809190504 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Wed, 24 Apr 2013 19:45:21 -0700 Subject: [PATCH] Fix compilation on platforms where int64_t == long --- aegisub/src/agi_pre.h | 1 + aegisub/src/auto4_lua_utils.h | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/aegisub/src/agi_pre.h b/aegisub/src/agi_pre.h index 2106f71ee..67d2b87c4 100644 --- a/aegisub/src/agi_pre.h +++ b/aegisub/src/agi_pre.h @@ -57,6 +57,7 @@ #include #include #include +#include #include #ifdef _WIN32 diff --git a/aegisub/src/auto4_lua_utils.h b/aegisub/src/auto4_lua_utils.h index f47872a3a..0ed36ab7c 100644 --- a/aegisub/src/auto4_lua_utils.h +++ b/aegisub/src/auto4_lua_utils.h @@ -21,17 +21,19 @@ #include #include +#include #include inline void push_value(lua_State *L, bool value) { lua_pushboolean(L, value); } inline void push_value(lua_State *L, const char *value) { lua_pushstring(L, value); } inline void push_value(lua_State *L, double value) { lua_pushnumber(L, value); } inline void push_value(lua_State *L, int value) { lua_pushinteger(L, value); } -inline void push_value(lua_State *L, size_t value) { lua_pushinteger(L, value); } -inline void push_value(lua_State *L, int64_t value) { lua_pushinteger(L, value); } -inline void push_value(lua_State *L, long value) { lua_pushinteger(L, value); } inline void push_value(lua_State *L, void *p) { lua_pushlightuserdata(L, p); } +template +typename std::enable_if::value>::type +push_value(lua_State *L, Integer value) { lua_pushinteger(L, value); } + inline void push_value(lua_State *L, wxString const& value) { lua_pushstring(L, value.utf8_str()); }