Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Provide PyFile_{Inc,Dec}UseCount and PyVarObject_HEAD_INIT that are m…

…issing from Python 2.5 (#34)
  • Loading branch information...
commit 30acea4c8a04243ba1bb93b1024ed8148e09f489 1 parent b8bdf05
Jonas Haag authored
Showing with 7 additions and 3 deletions.
  1. +5 −0 bjoern/25compat.h
  2. +2 −3 bjoern/common.h
5 bjoern/25compat.h
View
@@ -0,0 +1,5 @@
+#define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
+#define NOP do{}while(0)
+#define PyFile_IncUseCount(file) NOP
+#define PyFile_DecUseCount(file) NOP
+#define PyVarObject_HEAD_INIT(type, size) PyObject_HEAD_INIT(type) size,
5 bjoern/common.h
View
@@ -7,9 +7,8 @@
#include <stdbool.h>
#include <string.h>
-#ifndef Py_TYPE
-/* Python 2.5 compatibility */
-# define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
+#if PY_MINOR_VERSION < 6
+# include "25compat.h"
#endif
#define TYPE_ERROR_INNER(what, expected, ...) \
Please sign in to comment.
Something went wrong with that request. Please try again.