Support for MSYS2 builds (#3621)
This commit is contained in:
@@ -45,7 +45,8 @@ std::string iso8601(Timestamp timestamp) {
|
||||
std::tm info;
|
||||
_gmtime(&time, &info);
|
||||
char buffer[30];
|
||||
std::strftime(buffer, sizeof(buffer), "%F %T", &info);
|
||||
// %F and %T are not supported in MinGW (https://sourceforge.net/p/mingw-w64/bugs/793/)
|
||||
std::strftime(buffer, sizeof(buffer), "%Y-%m-%d %H:%M:%S", &info);
|
||||
return buffer;
|
||||
}
|
||||
|
||||
@@ -59,7 +60,8 @@ std::string iso8601(std::chrono::time_point<std::chrono::system_clock, Milliseco
|
||||
1000;
|
||||
|
||||
char buffer[sizeof("yyyy-mm-ddThh:mm:ss.000Z")];
|
||||
const std::size_t offset = std::strftime(buffer, sizeof(buffer), "%FT%T", &info);
|
||||
// %F and %T are not supported in MinGW (https://sourceforge.net/p/mingw-w64/bugs/793/)
|
||||
const std::size_t offset = std::strftime(buffer, sizeof(buffer), "%Y-%m-%dT%H:%M:%S", &info);
|
||||
snprintf(buffer + offset, sizeof(buffer) - offset, ".%03lldZ", ms);
|
||||
|
||||
return buffer;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <sstream>
|
||||
#include <fstream>
|
||||
|
||||
#ifdef __GNUC__
|
||||
#if defined(__GNUC__) && !defined(WIN32)
|
||||
#define MBGL_FOPEN_MODE_WBE "wbe"
|
||||
#else
|
||||
#define MBGL_FOPEN_MODE_WBE "wb"
|
||||
|
||||
Reference in New Issue
Block a user