0002-Build-failure-with-python-3-9.patch 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. From b3525e2a970ae3e783665040b1e0db5fc3391327 Mon Sep 17 00:00:00 2001
  2. From: Jose Zapater <jzapater@gmail.com>
  3. Date: Mon, 2 Nov 2020 09:46:17 +0100
  4. Subject: [PATCH] Build failure with python 3.9
  5. Signed-off-by: Jose Zapater <jzapater@gmail.com>
  6. [Retrieved from:
  7. https://github.com/domoticz/domoticz/commit/b3525e2a970ae3e783665040b1e0db5fc3391327]
  8. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  9. ---
  10. hardware/plugins/DelayedLink.h | 11 +++++++++++
  11. 1 file changed, 11 insertions(+)
  12. diff --git a/hardware/plugins/DelayedLink.h b/hardware/plugins/DelayedLink.h
  13. index c90a7d8e69..cb71478685 100644
  14. --- a/hardware/plugins/DelayedLink.h
  15. +++ b/hardware/plugins/DelayedLink.h
  16. @@ -14,6 +14,17 @@
  17. #include <frameobject.h>
  18. #include "../../main/Helper.h"
  19. +#ifndef _Py_DEC_REFTOTAL
  20. + /* _Py_DEC_REFTOTAL macro has been removed from Python 3.9 by:
  21. + https://github.com/python/cpython/commit/49932fec62c616ec88da52642339d83ae719e924 */
  22. +# ifdef Py_REF_DEBUG
  23. +# define _Py_DEC_REFTOTAL _Py_RefTotal--
  24. +# else
  25. +# define _Py_DEC_REFTOTAL
  26. +# define _Py_Dealloc
  27. +# endif
  28. +#endif
  29. +
  30. #if PY_VERSION_HEX >= 0x030800f0
  31. static inline void
  32. py3__Py_DECREF(const char *filename, int lineno, PyObject *op)