From: Anthony Shaw <anthony.p.shaw@gmail.com>
Date: Fri, 13 Sep 2024 20:17:13 +1000
Subject: Add some compat aliases for changes in the API

Forwarded: https://github.com/microsoft/picologging/pull/212/commits/8fb721136481c7266ef2fb2ca0802d54402e77e0

The modification in pyproject.toml did get excluded.
---
 src/picologging/compat.hxx | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/picologging/compat.hxx b/src/picologging/compat.hxx
index d3356da..be7a1fc 100644
--- a/src/picologging/compat.hxx
+++ b/src/picologging/compat.hxx
@@ -88,4 +88,12 @@ static inline PyObject* _Py_XNewRef(PyObject *obj)
 }
 #endif
 
+// For Python 3.13 and above, PyTime_t is now part of the public API
+#if PY_VERSION_HEX >= 0x030d0000
+#define _PyTime_t PyTime_t
+#define _PyTime_AsSecondsDouble PyTime_AsSecondsDouble
+#define _PyTime_AsMilliseconds PyTime_AsMilliseconds
+#define _PyTime_ROUND_CEILING PyTime_ROUND_CEILING
+#endif
+
 #endif // COMPAT_H
\ No newline at end of file
