Skip to content

Commit 56b0d6e

Browse files
committed
Fixes local_time c extension
1 parent 6efff7a commit 56b0d6e

File tree

1 file changed

+31
-31
lines changed

1 file changed

+31
-31
lines changed

pendulum/_extensions/tz/_local_time.c

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,20 @@
1212

1313
/* ------------------------------------------------------------------------- */
1414

15-
const int EPOCH_YEAR = 1970;
15+
#define EPOCH_YEAR 1970
1616

17-
const int DAYS_PER_N_YEAR = 365;
18-
const int DAYS_PER_L_YEAR = 366;
17+
#define DAYS_PER_N_YEAR 365
18+
#define DAYS_PER_L_YEAR 366
1919

20-
const int USECS_PER_SEC = 1000000;
20+
#define USECS_PER_SEC 1000000
2121

22-
const int SECS_PER_MIN = 60;
23-
const int SECS_PER_HOUR = 60 * SECS_PER_MIN;
24-
const int SECS_PER_DAY = SECS_PER_HOUR * 24;
22+
#define SECS_PER_MIN 60
23+
#define SECS_PER_HOUR (60 * SECS_PER_MIN)
24+
#define SECS_PER_DAY (SECS_PER_HOUR * 24)
2525

2626
// 400-year chunks always have 146097 days (20871 weeks).
27-
const long DAYS_PER_400_YEARS = 146097L;
28-
const long SECS_PER_400_YEARS = DAYS_PER_400_YEARS * SECS_PER_DAY;
27+
#define DAYS_PER_400_YEARS 146097L
28+
#define SECS_PER_400_YEARS (DAYS_PER_400_YEARS * SECS_PER_DAY)
2929

3030
// The number of seconds in an aligned 100-year chunk, for those that
3131
// do not begin with a leap year and those that do respectively.
@@ -36,7 +36,7 @@ const long SECS_PER_100_YEARS[2] = {
3636

3737
// The number of seconds in an aligned 4-year chunk, for those that
3838
// do not begin with a leap year and those that do respectively.
39-
const long SECS_PER_4_YEARS[2] = {
39+
const int SECS_PER_4_YEARS[2] = {
4040
(4 * DAYS_PER_N_YEAR + 0 * DAYS_PER_L_YEAR) * SECS_PER_DAY,
4141
(3 * DAYS_PER_N_YEAR + 1 * DAYS_PER_L_YEAR) * SECS_PER_DAY
4242
};
@@ -47,7 +47,7 @@ const int SECS_PER_YEAR[2] = {
4747
DAYS_PER_L_YEAR * SECS_PER_DAY
4848
};
4949

50-
const int MONTHS_PER_YEAR = 12;
50+
#define MONTHS_PER_YEAR 12
5151

5252
// The month lengths in non-leap and leap years respectively.
5353
const int DAYS_PER_MONTHS[2][13] = {
@@ -63,26 +63,26 @@ const int MONTHS_OFFSETS[2][14] = {
6363
{-1, 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366}
6464
};
6565

66-
const int TM_SUNDAY = 0;
67-
const int TM_MONDAY = 1;
68-
const int TM_TUESDAY = 2;
69-
const int TM_WEDNESDAY = 3;
70-
const int TM_THURSDAY = 4;
71-
const int TM_FRIDAY = 5;
72-
const int TM_SATURDAY = 6;
73-
74-
const int TM_JANUARY = 0;
75-
const int TM_FEBRUARY = 1;
76-
const int TM_MARCH = 2;
77-
const int TM_APRIL = 3;
78-
const int TM_MAY = 4;
79-
const int TM_JUNE = 5;
80-
const int TM_JULY = 6;
81-
const int TM_AUGUST = 7;
82-
const int TM_SEPTEMBER = 8;
83-
const int TM_OCTOBER = 9;
84-
const int TM_NOVEMBER = 10;
85-
const int TM_DECEMBER = 11;
66+
#define TM_SUNDAY 0
67+
#define TM_MONDAY 1
68+
#define TM_TUESDAY 2
69+
#define TM_WEDNESDAY 3
70+
#define TM_THURSDAY 4
71+
#define TM_FRIDAY 5
72+
#define TM_SATURDAY 6
73+
74+
#define TM_JANUARY 0
75+
#define TM_FEBRUARY 1
76+
#define TM_MARCH 2
77+
#define TM_APRIL 3
78+
#define TM_MAY 4
79+
#define TM_JUNE 5
80+
#define TM_JULY 6
81+
#define TM_AUGUST 7
82+
#define TM_SEPTEMBER 8
83+
#define TM_OCTOBER 9
84+
#define TM_NOVEMBER 10
85+
#define TM_DECEMBER 11
8686

8787
/* ------------------------------------------------------------------------- */
8888

0 commit comments

Comments
 (0)