** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: syserror.cpp,v 1.1 2000/06/19 02:58:08 kevin Exp $
+** $Id: syserror.cpp,v 1.3 2000/06/19 19:04:05 kevin Exp $
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License (version 2) as
******************************************************************************/
#include <iostream>
+#include <exception>
+#include <stdexcept>
#include <stdarg.h>
#include <ctype.h>
-#include "kstddef.h"
-#include "cio.h"
+#include "ctsupport.h"
/* NAME
sys_error (ERR_FATAL, "illegal error code #%d [sys_error]", severity);
}
- vfprintf (stdout, msg, arg);
-
- cout << "\n";
+ char errStr[512];
+ vsnprintf (errStr, sizeof(errStr), msg, arg);
+ cout << errStr << endl;
if (severity == ERR_FATAL)
- exit(1);
+ throw runtime_error (errStr);
#if INTERACTIVE_ERROR_DISPLAY
cout << "A - Abort C - Continue W - Turn off warnings? ";