Skip to content

Commit

Permalink
timeval: localtime_r, gmtime_r for Windows.
Browse files Browse the repository at this point in the history
Signed-off-by: Gurucharan Shetty <[email protected]>
Acked-by: Ben Pfaff <[email protected]>
  • Loading branch information
shettyg committed Mar 4, 2014
1 parent f0e4e85 commit 366d0f1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/timeval.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ BUILD_ASSERT_DECL(TYPE_IS_SIGNED(time_t));
#define TIME_MAX TYPE_MAXIMUM(time_t)
#define TIME_MIN TYPE_MINIMUM(time_t)

#ifdef _WIN32
#define localtime_r(timep, result) localtime_s(result, timep)
#define gmtime_r(timep, result) gmtime_s(result, timep)
#endif /* _WIN32 */

struct tm_msec {
struct tm tm;
int msec;
Expand Down

0 comments on commit 366d0f1

Please sign in to comment.