Skip to content

Commit

Permalink
MSVC compat
Browse files Browse the repository at this point in the history
  • Loading branch information
WillAyd committed Jul 11, 2023
1 parent f360f8f commit a0c25f4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions c/driver/sqlite/statement_reader.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,15 @@ static const char* ArrowTimestampToIsoString(int64_t value, enum ArrowTimeUnit u
assert(rem >= 0);

struct tm broken_down_time;
#ifdef _MSVC_VER
if (gmtime_s(&broken_down_time, &seconds) != 0) {
return NULL;
}
#else
if (gmtime_r(&seconds, &broken_down_time) != &broken_down_time) {
return NULL;
}
#endif

char* tsstr = malloc(strlen + 1);
if (tsstr == NULL) {
Expand Down

0 comments on commit a0c25f4

Please sign in to comment.