diff --git a/Common/LuaBindings.cpp b/Common/LuaBindings.cpp index 489211eef36c8ad3663823790fe9a41692805fcc..c2db76fa759e4024f3f65cf22d314406fe0fe221 100644 --- a/Common/LuaBindings.cpp +++ b/Common/LuaBindings.cpp @@ -42,14 +42,6 @@ extern "C" { #include "history.h" #endif -template <> -int luaCall<void>(lua_State *L,void (*_f)()) { - if (lua_gettop(L)==1) - lua_remove(L,1); - (*(_f))(); - return 1; -} - //trivial class to bind options class gmshOptions { public: diff --git a/Common/LuaBindings.h b/Common/LuaBindings.h index 9a7a015e8027eb7c1b8730e4d2d198d732ae4f48..78f89130360cb6ca5d48438242f9c1ee529d0911 100644 --- a/Common/LuaBindings.h +++ b/Common/LuaBindings.h @@ -497,8 +497,17 @@ static int luaCall(lua_State *L, void (*_f)(t0)) { (*(_f))(luaStack<t0>::get(L,1)); return 1; }; + template <> -int luaCall<void>(lua_State *L,void (*_f)()); +#if (__GNUC__< 4 || (_GNUC__ == 4 && __GNUC_MINOR__ < 3)) +static +#endif +int luaCall<void>(lua_State *L,void (*_f)()) { + if (lua_gettop(L)==1) + lua_remove(L,1); + (*(_f))(); + return 1; +} //const, return template <typename tObj, typename tRet, typename t0, typename t1, typename t2, typename t3>