void WriteErr( int errcode, va_list args ) { //============================================= // Write error message. char buffer[ERR_PREF_SIZE+ERR_BUFF_SIZE+1]; _AccessFIO(); // Before writing the error message, flush standard output files so that if // unit 6 is connected to the standard output device which has been // redirected to a file, the file gets flushed before the error message is // written. FlushStdUnit(); strcpy( buffer, ErrorPref ); BldErrCode( errcode, &buffer[ ERR_PREF_SIZE ] ); __BldErrMsg( errcode, &buffer[ERR_PREF_SIZE + ERR_CODE_SIZE], args ); if( __EnterWVIDEO( buffer ) ) { StdBuffer(); } else { StdBuffer(); StdWriteNL( buffer, strlen( buffer ) ); } ERR_HOOK( errcode, buffer ); StdFlush(); _ReleaseFIO(); }
_WCRTLINK void __fatal_runtime_error( char _WCI86FAR *msg, unsigned retcode ) /*****************************************************************/ { if( !__EnterWVIDEO( msg ) ) { __exit_with_msg( msg, retcode ); } }
_WCRTLINK _NORETURN void __fatal_runtime_error( char _WCI86FAR *msg, unsigned retcode ) { if( __EnterWVIDEO( msg ) ) _sys_exit( retcode ); __exit_with_msg( msg, retcode ); // never return }
_WCNORETURN void CPPLIB( fatal_runtime_error )( // FATAL RUNTIME ERROR char *msg, // - diagnostic message int code ) // - exit code { if( __EnterWVIDEO( msg ) ) std::exit( code ); // never return __exit_with_msg( msg, code ); // never return }