Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upstd::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> | |||
eddelbuettel
Jan 3, 2017
Owner
Can we make the include conditional on being compiled with MinGW? Just to minimise side-effects...
Can we make the include conditional on being compiled with MinGW? Just to minimise side-effects...
| namespace detail { | ||
|
|
||
| namespace { | ||
| namespace RcppCCTZ { |
eddelbuettel
Jan 3, 2017
Owner
And maybe keep the existing namespace?
And maybe keep the existing namespace?
| #else | ||
| dp = strptime(dp, fmt, tm); | ||
| #endif | ||
| dp = RcppCCTZ::strptime(dp, fmt, tm); |
eddelbuettel
Jan 3, 2017
Owner
Maybe standard strptime() most of the time and our if and when we have no alternative?
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__ | |||
eddelbuettel
Jan 6, 2017
Owner
That one probably needs to go eventually.
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); | |||
eddelbuettel
Jan 6, 2017
Owner
That's a better namespace -- +1
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. |
de8629f
into
eddelbuettel:master
This adds a backport of
std::get_time(in thestd_backportsnamespace) and shores up thestrptime()implementation based onstd::get_time.Windows here we come!