summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2015-03-19 16:47:23 +0100
committerWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2015-03-19 16:48:45 +0100
commitd1ad446669cea2a76d7146023e4862a1fdbf3e13 (patch)
tree359dd5405b8bc24daabbb56640d1017f3ac79605
parent476fd5388da4aa6e23658460199e26e88e05dc5d (diff)
downloadastra-d1ad446669cea2a76d7146023e4862a1fdbf3e13.tar.gz
astra-d1ad446669cea2a76d7146023e4862a1fdbf3e13.tar.bz2
astra-d1ad446669cea2a76d7146023e4862a1fdbf3e13.tar.xz
astra-d1ad446669cea2a76d7146023e4862a1fdbf3e13.zip
Fix windows build
-rw-r--r--include/astra/Logging.h4
-rw-r--r--include/astra/clog.h11
2 files changed, 14 insertions, 1 deletions
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 <stdio.h>
#include <string.h>
#include <time.h>
+#ifndef _MSC_VER
#include <unistd.h>
+#else
+#include <io.h>
+#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
}
}