#ifndef REVIVER_ASSERT_HPP #define REVIVER_ASSERT_HPP #include #include #include /*! \file \brief Implementation of assert functions This file contains an assert function implementation */ /*! \brief Assert function This function prints error messages along with file and line numbers \param b bool to be checked \param desc Error message \param line Line number \param file File name \return True is there is no error */ bool MyAssertFunction( bool b, char* desc, int line, char* file){ if (b) return true; std::cerr << "\n\nAssertion Failure\n"; std::cerr << "Description : " << desc << std::endl; std::cerr << "Filename : " << file << std::endl; std::cerr << "Line No : " << line << std::endl; exit(1); } #if defined( _DEBUG ) #define Assert( exp, description ) MyAssertFunction( (int)(exp), description, __LINE__, __FILE__ ) #else #define Assert( exp, description ) #endif #endif