From d1ad446669cea2a76d7146023e4862a1fdbf3e13 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Thu, 19 Mar 2015 16:47:23 +0100 Subject: Fix windows build --- include/astra/Logging.h | 4 +++- include/astra/clog.h | 11 +++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/include/astra/Logging.h b/include/astra/Logging.h index e822c24..8e19ea4 100644 --- a/include/astra/Logging.h +++ b/include/astra/Logging.h @@ -29,6 +29,8 @@ $Id$ #ifndef _INC_ASTRA_LOGGING #define _INC_ASTRA_LOGGING +#include "astra/Globals.h" + #define ASTRA_DEBUG(...) astra::CLogger::debug(__FILE__,__LINE__, __VA_ARGS__) #define ASTRA_INFO(...) astra::CLogger::info(__FILE__,__LINE__, __VA_ARGS__) #define ASTRA_WARN(...) astra::CLogger::warn(__FILE__,__LINE__, __VA_ARGS__) @@ -44,7 +46,7 @@ enum log_level { LOG_ERROR }; -class CLogger +class _AstraExport CLogger { CLogger(); ~CLogger(); diff --git a/include/astra/clog.h b/include/astra/clog.h index ce082df..c0cbae4 100644 --- a/include/astra/clog.h +++ b/include/astra/clog.h @@ -71,7 +71,15 @@ #include #include #include +#ifndef _MSC_VER #include +#else +#include +#define open _open +#define close _close +#define write _write +#define snprintf _snprintf +#endif /* Number of loggers that can be defined. */ #define CLOG_MAX_LOGGERS 16 @@ -625,7 +633,10 @@ _clog_log(const char *sfile, int sline, enum clog_level level, if (dynbuf != buf) { free(dynbuf); } +#ifndef _MSC_VER + // FIXME fsync(logger->fd); +#endif } } -- cgit v1.2.3