summaryrefslogtreecommitdiff
path: root/node/Logger.cpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@zerotier.com>2013-08-12 21:25:36 -0400
committerAdam Ierymenko <adam.ierymenko@zerotier.com>2013-08-12 21:25:36 -0400
commitd6414c9ff74e3f8076a1e94d3c6074366119900e (patch)
treeb0620f1f1610b51b386964d6758b5787b6cb7d6f /node/Logger.cpp
parent5076c75b079fe02c843ca85dc20821e468b2d7b8 (diff)
downloadinfinitytier-d6414c9ff74e3f8076a1e94d3c6074366119900e.tar.gz
infinitytier-d6414c9ff74e3f8076a1e94d3c6074366119900e.zip
Windows compiles! (w/Visual Studio 2012) That's about all it does, but it's a start.
Diffstat (limited to 'node/Logger.cpp')
-rw-r--r--node/Logger.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/node/Logger.cpp b/node/Logger.cpp
index 7bed5990..71b4893d 100644
--- a/node/Logger.cpp
+++ b/node/Logger.cpp
@@ -30,6 +30,8 @@
#include <string.h>
#include <stdarg.h>
#include <time.h>
+
+#include "Constants.hpp"
#include "Logger.hpp"
namespace ZeroTier {
@@ -64,7 +66,12 @@ void Logger::log(const char *fmt,...)
if (_log) {
time_t now = time(0);
+#ifdef __WINDOWS__
+ ctime_s(tmp,sizeof(tmp),&now);
+ char *nowstr = tmp;
+#else
char *nowstr = ctime_r(&now,tmp);
+#endif
for(char *c=nowstr;*c;++c) {
if (*c == '\n')
*c = '\0';