platform eol

This commit is contained in:
gabime
2014-03-16 19:51:43 +02:00
parent 9d9a955e94
commit 08ba1791ba
4 changed files with 17 additions and 8 deletions

View File

@@ -49,14 +49,14 @@ public:
{
if (_enabled)
{
_oss << '\n';
_oss << os::eol();
_callback_logger->_log_it(_oss.str_ref(), _level);
}
}
template<typename T>
line_logger&& operator<<(const T& msg) &&
line_logger&& operator<<(const T& msg)
{
if (_enabled)
_oss << msg;

View File

@@ -14,7 +14,7 @@ inline std::tm localtime(const std::time_t &time_tt)
{
std::tm tm;
#ifdef _MSC_VER
#ifdef _WIN32
localtime_s(&tm, &time_tt);
#else
localtime_r(&time_tt, &tm);
@@ -47,9 +47,17 @@ inline bool operator!=(const std::tm& tm1, const std::tm& tm2)
return !(tm1==tm2);
}
inline const char* eol()
{
#ifdef _WIN32
return "\r\n";
#else
return "\n";
#endif
}
}
}
} //os
} //details
} //c11log