run_time_functions.cpp
Go to the documentation of this file.
00001 
00009 /*****************************************************************************
00010 ** Includes
00011 *****************************************************************************/
00012 
00013 #include <cstdio>
00014 #include "../../include/ecl/errors/run_time_functions.hpp"
00015 #include "../../include/ecl/errors/handlers.hpp"
00016 
00017 /*****************************************************************************
00018 ** Function Implementation [assert]
00019 *****************************************************************************/
00020 
00021 #if defined(NDEBUG) || defined(ECL_NDEBUG)
00022 #else
00023     void ecl_run_time_assert ( bool requirement, const char* location, const char* msg)
00024     {
00025         if ( !requirement )
00026         {
00027             fputs ("Location : ", stderr);
00028             fputs ( location ,stderr);
00029             fputs ("\n", stderr);
00030             fputs ("Message  : ", stderr);
00031             fputs ( msg, stderr);
00032             fputs ( "\n", stderr);
00033             ::abort();
00034         }
00035     }
00036     void ecl_run_time_assert ( bool requirement, const char* location, ecl::ErrorFlag type)
00037     {
00038         if ( !requirement )
00039         {
00040             fputs ("Location : ", stderr);
00041             fputs ( location ,stderr);
00042             fputs ("\n", stderr);
00043             fputs ("Message  : ", stderr);
00044             fputs ( ecl::Error(type).what(), stderr);
00045             fputs ( "\n", stderr);
00046             ::abort();
00047         }
00048     }
00049 #endif
00050 
00051 
00052 /*****************************************************************************
00053 ** Function Implementation [abort]
00054 *****************************************************************************/
00055 
00056 void ecl_run_time_abort ( const char* location, const char* msg)
00057 {
00058     fputs ( "Location : ", stderr);
00059     fputs ( location, stderr);
00060     fputs ("\nMessage  : ", stderr);
00061     fputs ( msg, stderr);
00062     fputs ( "\n", stderr);
00063     ::abort();
00064 }
00065 
00066 void ecl_run_time_abort ( const char* location,  ecl::ErrorFlag type )
00067 {
00068     fputs ( "Location : ", stderr);
00069     fputs ( location,stderr);
00070     fputs ("\nMessage  : ", stderr);
00071     fputs ( ecl::Error(type).what(), stderr);
00072     fputs ( "\n", stderr);
00073     ::abort();
00074 }
00075 


ecl_errors
Author(s): Daniel Stonier (d.stonier@gmail.com)
autogenerated on Thu Jan 2 2014 11:11:33