Skip to content

Commit

Permalink
Timestamp: Update workaround to support MinGW alongside MSVC (#296)
Browse files Browse the repository at this point in the history
  • Loading branch information
Doekin authored Dec 18, 2024
1 parent 5934aea commit fe8a5c5
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions include/rfl/Timestamp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@

#include <ctime>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <locale>
#include <sstream>
#include <stdexcept>
#include <string>
Expand Down Expand Up @@ -75,8 +72,8 @@ class Timestamp {
const std::tm& tm() const { return tm_; }

private:
#ifdef _MSC_VER
// This workaround is necessary, because MSVC doesn't support strptime.
#if defined(_MSC_VER) || defined(__MINGW32__)
// This workaround is necessary, because strptime is not available on Windows.
char* strptime(const char* _s, const char* _f, std::tm* _tm) {
std::istringstream input(_s);
input.imbue(std::locale(setlocale(LC_ALL, nullptr)));
Expand Down

0 comments on commit fe8a5c5

Please sign in to comment.