summaryrefslogtreecommitdiff
path: root/riff/Logger.cpp
diff options
context:
space:
mode:
authorSrimanta Panda <srimanta.panda@stericsson.com>2011-10-13 10:17:16 +0200
committerSrimanta Panda <srimanta.panda@stericsson.com>2011-10-13 10:27:32 +0200
commit7b1ae2029ad33a38e1e718a33e2879325b389332 (patch)
treea86e4cb793dff0147649c5731b46981ac701fed5 /riff/Logger.cpp
parentfac26f795cf96ec624a3a334ba9b78ea2d86811d (diff)
Added Windows Support
RIFF will be supported for the Windows platform. It requires libusb-win32 library to build it.
Diffstat (limited to 'riff/Logger.cpp')
-rw-r--r--riff/Logger.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/riff/Logger.cpp b/riff/Logger.cpp
index a54e447..186451a 100644
--- a/riff/Logger.cpp
+++ b/riff/Logger.cpp
@@ -15,6 +15,7 @@
* @{
*/
+
#include "Logger.h"
#include <string>
#include <cstdio>
@@ -23,6 +24,14 @@
#include <cstddef>
using namespace std;
+#ifdef _WIN32
+#define flockfile _lock_file
+#define funlockfile _unlock_file
+#define popen _popen
+#define pclose _pclose
+#define localtime_r(t, lt) localtime_s(lt, t)
+#endif
+
bool Logger::verbose_;
Logger::Logger(const string& name):
@@ -42,7 +51,7 @@ void Logger::log(LogSeverity severity, const char* format, ...) const
tm lt;
localtime_r(&t, &lt);
- if (verbose_ || severity == Logger::PROGRESS || severity == Logger::ERROR) {
+ if (verbose_ || severity == Logger::PROGRESS || severity == Logger::ERR) {
flockfile(console_);
fprintf(console_, "%02d:%02d:%02d ", lt.tm_hour, lt.tm_min, lt.tm_sec);