Ignore:
Timestamp:
06/20/15 00:05:17 (10 years ago)
Author:
epyon
Message:
  • code compiles cleanly on maximum warning level
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lua/lua_function.cc

    r395 r406  
    55// For conditions of distribution and use, see copying.txt file in root folder.
    66
    7 #include <nv/lua/lua_function.hh>
     7#include "nv/lua/lua_function.hh"
    88
    9 #include <nv/lua/lua_raw.hh>
     9#include "nv/core/logging.hh"
     10#include "nv/lua/lua_raw.hh"
    1011
    1112using namespace nv;
     13
     14#define NV_LUA_ABORT( func, ... ) \
     15        NV_LOG_CRITICAL( "lua::" func " : ", __VA_ARGS__ ) \
     16        NV_ABORT( "lua::" func " : critical error!" )
    1217
    1318lua::function_base::function_base( lua_State* a_L, const path& a_path, bool a_global /*= true*/ ) : L(a_L)
     
    1621        {
    1722                lua_pop( L, 1 );
    18                 throw std::runtime_error("not a valid path - " + a_path.to_string() );
     23                NV_LUA_ABORT( "function_base::function_base", "not a valid path - ", a_path.to_string() );
    1924        }
    2025
     
    2227        {
    2328                lua_pop( L, 1 );
    24                 throw std::runtime_error("not a valid function - " + a_path.to_string() );
     29                NV_LUA_ABORT( "function_base::function_base", "not a valid function - ", a_path.to_string() );
    2530        }
    2631        m_ref = luaL_ref( L, LUA_REGISTRYINDEX );
     
    6166                std::string error = lua_tostring( L, -1 );
    6267                lua_pop( L, 1 );
    63                 throw std::runtime_error(error.c_str());
     68                NV_LUA_ABORT( "function_base::call", "call failed - ", error.c_str() );
    6469        }
    6570}
Note: See TracChangeset for help on using the changeset viewer.