@@ -981,6 +981,12 @@ new_date_ex(int year, int month, int day, PyTypeObject *type)
981981#define new_date (year , month , day ) \
982982 new_date_ex(year, month, day, &PyDateTime_DateType)
983983
984+ static PyObject *
985+ new_date_capi (int year , int month , int day , PyTypeObject * type )
986+ {
987+ return new_date_ex (year , month , day , type );
988+ }
989+
984990// Forward declaration
985991static PyObject *
986992new_datetime_ex (int , int , int , int , int , int , int , PyObject * , PyTypeObject * );
@@ -1176,7 +1182,7 @@ new_time_fold_capi(int hour, int minute, int second, int usecond,
11761182 return new_time_ex2 (hour , minute , second , usecond , tzinfo , fold , type );
11771183}
11781184
1179- #define new_time (hh , mm , ss , us , tzinfo , fold ) \
1185+ #define new_time (hh , mm , ss , us , tzinfo , fold ) \
11801186 new_time_ex2(hh, mm, ss, us, tzinfo, fold, &PyDateTime_TimeType)
11811187
11821188static PyObject *
@@ -1230,6 +1236,13 @@ new_delta_ex(int days, int seconds, int microseconds, int normalize,
12301236#define new_delta (d , s , us , normalize ) \
12311237 new_delta_ex(d, s, us, normalize, &PyDateTime_DeltaType)
12321238
1239+ static PyObject *
1240+ new_delta_capi (int days , int seconds , int microseconds , int normalize ,
1241+ PyTypeObject * type )
1242+ {
1243+ return new_delta_ex (days , seconds , microseconds , normalize , type );
1244+ }
1245+
12331246
12341247typedef struct
12351248{
@@ -5266,6 +5279,12 @@ datetime_fromtimestamp(PyObject *cls, PyObject *args, PyObject *kw)
52665279 return self ;
52675280}
52685281
5282+ static PyObject *
5283+ datetime_fromtimestamp_capi (PyObject * cls , PyObject * args , PyObject * kw )
5284+ {
5285+ return datetime_fromtimestamp (cls , args , kw );
5286+ }
5287+
52695288/* Return new UTC datetime from timestamp (Python timestamp -- a double). */
52705289static PyObject *
52715290datetime_utcfromtimestamp (PyObject * cls , PyObject * args )
@@ -6753,12 +6772,12 @@ get_datetime_capi(void)
67536772 capi -> TimeType = & PyDateTime_TimeType ;
67546773 capi -> DeltaType = & PyDateTime_DeltaType ;
67556774 capi -> TZInfoType = & PyDateTime_TZInfoType ;
6756- capi -> Date_FromDate = new_date_ex ;
6775+ capi -> Date_FromDate = new_date_capi ;
67576776 capi -> DateTime_FromDateAndTime = new_datetime_capi ;
67586777 capi -> Time_FromTime = new_time_capi ;
6759- capi -> Delta_FromDelta = new_delta_ex ;
6778+ capi -> Delta_FromDelta = new_delta_capi ;
67606779 capi -> TimeZone_FromTimeZone = new_timezone_capi ;
6761- capi -> DateTime_FromTimestamp = datetime_fromtimestamp ;
6780+ capi -> DateTime_FromTimestamp = datetime_fromtimestamp_capi ;
67626781 capi -> Date_FromTimestamp = datetime_date_fromtimestamp_capi ;
67636782 capi -> DateTime_FromDateAndTimeAndFold = new_datetime_fold_capi ;
67646783 capi -> Time_FromTimeAndFold = new_time_fold_capi ;
0 commit comments