From 19ee5b4f891a880761ad95a4a06227caeeb5cff9 Mon Sep 17 00:00:00 2001 From: montag451 Date: Sun, 7 Oct 2012 14:18:48 +0200 Subject: [PATCH] Should now compile on old distributions --- pytun.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pytun.c b/pytun.c index 1e8ffcc..4eec12e 100644 --- a/pytun.c +++ b/pytun.c @@ -13,6 +13,11 @@ #include #include +#ifndef PyVarObject_HEAD_INIT +#define PyVarObject_HEAD_INIT(type, size) \ + PyObject_HEAD_INIT(type) size, +#endif + static PyObject* pytun_error; PyDoc_STRVAR(pytun_error_doc, @@ -647,9 +652,17 @@ PyMODINIT_FUNC initpytun(void) PyModule_AddIntConstant(m, "IFF_TUN", IFF_TUN); PyModule_AddIntConstant(m, "IFF_TAP", IFF_TAP); +#ifdef IFF_NO_PI PyModule_AddIntConstant(m, "IFF_NO_PI", IFF_NO_PI); +#endif +#ifdef IFF_ONE_QUEUE PyModule_AddIntConstant(m, "IFF_ONE_QUEUE", IFF_ONE_QUEUE); +#endif +#ifdef IFF_VNET_HDR PyModule_AddIntConstant(m, "IFF_VNET_HDR", IFF_VNET_HDR); +#endif +#ifdef IFF_TUN_EXCL PyModule_AddIntConstant(m, "IFF_TUN_EXCL", IFF_TUN_EXCL); +#endif }