Skip to content

Commit eb4110f

Browse files
committed
Fix gmtime_s detection in kms_request.c
1 parent 82db427 commit eb4110f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/kms-message/src/kms_request.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,12 @@ kms_request_set_date (kms_request_t *request, const struct tm *tm)
153153
/* use current time */
154154
time_t t;
155155
time (&t);
156-
#ifdef _WIN32
156+
#if defined(BSON_HAVE_GMTIME_R)
157+
gmtime_r (&t, &tmp_tm);
158+
#elif defined(_MSC_VER)
157159
gmtime_s (&tmp_tm, &t);
158160
#else
159-
gmtime_r (&t, &tmp_tm);
161+
tmp_tm = *gmtime (&t);
160162
#endif
161163
tm = &tmp_tm;
162164
}

0 commit comments

Comments
 (0)