Major rework of headers inclusion style Part2 on behalf of lebedev.ri (issue 1079)

This commit is contained in:
michael
2011-12-17 12:14:44 -05:00
parent bf71a01ca5
commit 815ba5b321
43 changed files with 5621 additions and 84 deletions

56
rtengine/klt/error.cc Normal file
View File

@@ -0,0 +1,56 @@
/*********************************************************************
* error.c
*
* Error and warning messages, and system commands.
*********************************************************************/
/* Standard includes */
#include <cstdio>
#include <cstdlib>
#include <cstdarg>
/*********************************************************************
* KLTError
*
* Prints an error message and dies.
*
* INPUTS
* exactly like printf
*/
void KLTError(char *fmt, ...)
{
va_list args;
va_start(args, fmt);
fprintf(stderr, "KLT Error: ");
vfprintf(stderr, fmt, args);
fprintf(stderr, "\n");
va_end(args);
exit(1);
}
/*********************************************************************
* KLTWarning
*
* Prints a warning message.
*
* INPUTS
* exactly like printf
*/
void KLTWarning(char *fmt, ...)
{
va_list args;
va_start(args, fmt);
fprintf(stderr, "KLT Warning: ");
vfprintf(stderr, fmt, args);
fprintf(stderr, "\n");
fflush(stderr);
va_end(args);
}