-
Notifications
You must be signed in to change notification settings - Fork 8
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
std::get_time and strptime for the truly unfortunate. (Closes #9) #11
Conversation
@@ -31,27 +31,43 @@ | |||
#if !HAS_STRPTIME | |||
#include <iomanip> | |||
#include <sstream> | |||
#include <get_time.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make the include conditional on being compiled with MinGW? Just to minimise side-effects...
namespace detail { | ||
|
||
namespace { | ||
namespace RcppCCTZ { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And maybe keep the existing namespace?
#else | ||
dp = strptime(dp, fmt, tm); | ||
#endif | ||
dp = RcppCCTZ::strptime(dp, fmt, tm); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe standard strptime()
most of the time and our if and when we have no alternative?
… my desk to my bedroom because my network isn't quite right.
@@ -12,6 +12,8 @@ | |||
// See the License for the specific language governing permissions and | |||
// limitations under the License. | |||
|
|||
#define __MINGW64__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That one probably needs to go eventually.
@@ -516,7 +523,7 @@ const char* ParseSubSeconds(const char* dp, | |||
// Parses a string into a std::tm using strptime(3). | |||
const char* ParseTM(const char* dp, const char* fmt, std::tm* tm) { | |||
if (dp != nullptr) { | |||
dp = RcppCCTZ::strptime(dp, fmt, tm); | |||
dp = cctz::detail::strptime(dp, fmt, tm); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a better namespace -- +1
Lol read the commit comment |
Ouch. Damn ipOverPower messing with you? |
…Removed testing ode.
I am not sure I like the last change set. I don;t think I want to change away from But it looks like you have a build failure to catch anyway? |
Gotcha...no more time tonight. Will have to address in the morning. For now, everything should work correctly on every platform. |
This adds a backport of
std::get_time
(in thestd_backports
namespace) and shores up thestrptime()
implementation based onstd::get_time
.Windows here we come!