Skip to content

Commit 7975b4e

Browse files
author
Derick Rethans
committed
- MFH: Fixed windows compile error.
1 parent bb82fb0 commit 7975b4e

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

ext/date/lib/timelib_structs.h

+11-4
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,13 @@ typedef signed long long timelib_sll;
7474
#define uint32_t unsigned __int32
7575
#endif
7676

77+
#if defined(_MSC_VER)
78+
#define TIMELIB_LL_CONST(n) n ## i64
79+
#else
80+
#define TIMELIB_LL_CONST(n) n ## ll
81+
#endif
82+
83+
7784
typedef struct ttinfo
7885
{
7986
int32_t offset;
@@ -189,10 +196,10 @@ typedef struct _timelib_tzdb {
189196
#define TIMELIB_ZONETYPE_ABBR 2
190197
#define TIMELIB_ZONETYPE_ID 3
191198

192-
#define SECS_PER_ERA 12622780800LL
193-
#define SECS_PER_DAY 86400
194-
#define DAYS_PER_YEAR 365
195-
#define DAYS_PER_LYEAR 366
199+
#define SECS_PER_ERA TIMELIB_LL_CONST(12622780800)
200+
#define SECS_PER_DAY 86400
201+
#define DAYS_PER_YEAR 365
202+
#define DAYS_PER_LYEAR 366
196203

197204
#define timelib_is_leap(y) ((y) % 4 == 0 && ((y) % 100 != 0 || (y) % 400 == 0))
198205

ext/date/lib/unixtime2tm.c

-6
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,6 @@
3232
#include <strings.h>
3333
#endif
3434

35-
#if defined(_MSC_VER)
36-
#define TIMELIB_LL_CONST(n) n ## i64
37-
#else
38-
#define TIMELIB_LL_CONST(n) n ## ll
39-
#endif
40-
4135
static int month_tab_leap[12] = { -1, 30, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };
4236
static int month_tab[12] = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };
4337

0 commit comments

Comments
 (0)