Skip to content

Commit fe8a5c5

Browse files
authored
Timestamp: Update workaround to support MinGW alongside MSVC (#296)
1 parent 5934aea commit fe8a5c5

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

include/rfl/Timestamp.hpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33

44
#include <ctime>
55
#include <iomanip>
6-
#include <iostream>
7-
#include <iterator>
8-
#include <locale>
96
#include <sstream>
107
#include <stdexcept>
118
#include <string>
@@ -75,8 +72,8 @@ class Timestamp {
7572
const std::tm& tm() const { return tm_; }
7673

7774
private:
78-
#ifdef _MSC_VER
79-
// This workaround is necessary, because MSVC doesn't support strptime.
75+
#if defined(_MSC_VER) || defined(__MINGW32__)
76+
// This workaround is necessary, because strptime is not available on Windows.
8077
char* strptime(const char* _s, const char* _f, std::tm* _tm) {
8178
std::istringstream input(_s);
8279
input.imbue(std::locale(setlocale(LC_ALL, nullptr)));

0 commit comments

Comments
 (0)