1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
#ifdef _MSC_VER
#include <stdarg.h>
#include <stdio.h>
#include <windows.h>
#include <syslog.h>
/* Implementation of syslog for Windows */
void
syslog(int priority, const char *format, ...)
{
va_list args;
char buffer[4096]; /* Using a reasonable buffer size */
va_start(args, format);
vsnprintf(buffer, sizeof(buffer), format, args);
va_end(args);
/* Log to Windows event log or just output to stderr */
fprintf(stderr, "syslog: %s", buffer);
}
/* Implementation of closelog for Windows */
void
closelog(void)
{
/* Do nothing on Windows */
}
#endif /* _MSC_VER */
|