mirror of https://github.com/BOINC/boinc.git
Visual C++ is not standard-compliant
git-svn-id: svn+ssh://cvs.lpds.sztaki.hu/var/lib/svn/szdg/dcapi/trunk@703 a7169a2c-3604-0410-bc95-c702d8d87f7a
This commit is contained in:
parent
f23325e93a
commit
b909d11eaf
|
@ -1,4 +1,7 @@
|
||||||
#include <sys/syslog.h>
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include <config.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
@ -6,6 +9,10 @@
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
|
#include <sys/syslog.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <dc_common.h>
|
#include <dc_common.h>
|
||||||
#include <dc_internal.h>
|
#include <dc_internal.h>
|
||||||
|
|
||||||
|
@ -17,13 +24,21 @@
|
||||||
static int loglevel = -1;
|
static int loglevel = -1;
|
||||||
static FILE *logfile;
|
static FILE *logfile;
|
||||||
|
|
||||||
|
/* Stupid Visual C compiler */
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#define INIT(x, y) y
|
||||||
|
#else
|
||||||
|
#define INIT(x, y) [x] = y
|
||||||
|
#endif
|
||||||
|
|
||||||
static const char *levels[] =
|
static const char *levels[] =
|
||||||
{
|
{
|
||||||
[LOG_DEBUG] = "Debug",
|
INIT(LOG_DEBUG, "Debug"),
|
||||||
[LOG_INFO] = "Info",
|
INIT(LOG_INFO, "Info"),
|
||||||
[LOG_NOTICE] = "Notice",
|
INIT(LOG_NOTICE, "Notice"),
|
||||||
[LOG_WARNING] = "Warning",
|
INIT(LOG_WARNING, "Warning"),
|
||||||
[LOG_ERR] = "Error"
|
INIT(LOG_ERR, "Error"),
|
||||||
|
INIT(LOG_CRIT, "Critical")
|
||||||
};
|
};
|
||||||
|
|
||||||
static void init_log(void)
|
static void init_log(void)
|
||||||
|
|
Loading…
Reference in New Issue