areas will not step on each others feet... Added comments all over the place. Bugs squished git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2248 a95241bf-73f2-0310-859d-f6bbb57e9c96
21 lines
555 B
C++
21 lines
555 B
C++
#include <OS.h>
|
|
#include <stdio.h>
|
|
#include <stdarg.h>
|
|
|
|
static sem_id errorPrinting=0;
|
|
|
|
// Create a function for standardized formats. Wish I could get rid of the warning associated with this...
|
|
void error(char *fmt, ...)
|
|
{
|
|
if (errorPrinting==0)
|
|
errorPrinting=create_sem(1,"error_printing");
|
|
acquire_sem(errorPrinting);
|
|
va_list argp;
|
|
char tmp[2000];
|
|
sprintf(tmp, "[%lld] error: %s",real_time_clock_usecs(),fmt);
|
|
va_start(argp, tmp);
|
|
vfprintf(stderr,tmp,argp);
|
|
va_end(argp);
|
|
release_sem(errorPrinting);
|
|
}
|