-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Timestamp: Update workaround to support MinGW alongside MSVC #296
Conversation
Switch to `std::get_time` for better portability and compatibility with modern C++ standards.
Hi, my concern with the get_time solution is that strptime is more efficient. I'd rather only use strptime where possible and use the workaround where necessary. Or is there any specific problem you encountered because of that? |
Hi,
Since That said, I understand your concern about efficiency. I’ll run a benchmark to evaluate the performance difference and see if the trade-off is reasonable. Let me follow up with the results soon. |
A quick benchmark shows |
@Doekin, no problem. Let's try to resolve your issue by finding a macro that captures your case as well. |
strptime
with std::get_time
for better compatibility
|
3e6709a
to
ad12d2d
Compare
@Doekin, merged. Thanks for your contribution! |
Original
Timestamp: Replace
strptime
withstd::get_time
for better compatibilityThe
strptime
function is a POSIX extension, not universally supported by all compilers (e.g., MSVC). Replacing it withstd::get_time
, which is part of the C++ standard, improves cross-platform compatibility without sacrificing functionality.Edit
std::get_time
has poor performance compared tostrptime
. My issue was that MinGW failed to compilereflect-cpp
due to the lack ofstrptime
. A more precise solution is to extend the existing workaround to cover MinGW, while keepingstrptime
for better performance on supported platforms.