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
fix timestamp_no_ms() for 32bit #3292
Conversation
This pull request has been linked to Shortcut Story #18759: timestamp_now_ms() incorrect in 32bit environment. |
tiledb/sm/misc/tdb_time.cc
Outdated
@@ -44,9 +44,9 @@ namespace tiledb::sm::utils::time { | |||
|
|||
uint64_t timestamp_now_ms() { | |||
#ifdef _WIN32 | |||
struct _timeb tb; | |||
struct __timeb64 tb; | |||
memset(&tb, 0, sizeof(struct _timeb)); |
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.
If you switch from struct _timeb
to struct __timeb64
the memset()
may need adjusting too.
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.
Noting for the record, from discussion: the original _ftime_s
usage was OK in MSVC because (AFAICT) _32BIT_TIME_T
is not defined by default. However, it did not work correctly with mingw.
change for 32/64 bit consistency (corrects return of incorrect 32bit values)
(affects rtools40 32bit build)
TYPE: BUG
DESC: fix timestamp_no_ms() for 32bit