changed copyright years in source files
[fegdk.git] / core / code / system / misc.cpp
blob71712a9ab1c05efc541fc92a87aca33784e3cf2e
1 #include "f_types.h"
2 #include <stdarg.h>
3 #include <stdio.h>
4 #include <stdlib.h>
6 namespace fe {
8 void sys_error (const char *fmt, ...) {
9 int n;
10 const int size = 1024;
11 char p[size];
12 va_list ap;
14 va_start(ap, fmt);
15 n = vsnprintf(p, size, fmt, ap);
16 va_end(ap);
17 if (n > -1 && n < size)
18 sys_printf ("ERROR: %s\n", p);
19 else
20 sys_printf ("ERROR: [err string is too large to format]\n");
21 sys_exit (-1);
24 void
25 sys_exit (int errcode) {
26 exit (-1);