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:
gombasg 2006-06-19 10:24:21 +00:00 committed by Adam Visegradi
parent f23325e93a
commit b909d11eaf
1 changed files with 21 additions and 6 deletions

View File

@ -1,4 +1,7 @@
#include <sys/syslog.h>
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
@ -6,6 +9,10 @@
#include <errno.h>
#include <time.h>
#ifndef _WIN32
#include <sys/syslog.h>
#endif
#include <dc_common.h>
#include <dc_internal.h>
@ -17,13 +24,21 @@
static int loglevel = -1;
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[] =
{
[LOG_DEBUG] = "Debug",
[LOG_INFO] = "Info",
[LOG_NOTICE] = "Notice",
[LOG_WARNING] = "Warning",
[LOG_ERR] = "Error"
INIT(LOG_DEBUG, "Debug"),
INIT(LOG_INFO, "Info"),
INIT(LOG_NOTICE, "Notice"),
INIT(LOG_WARNING, "Warning"),
INIT(LOG_ERR, "Error"),
INIT(LOG_CRIT, "Critical")
};
static void init_log(void)