More #ifdef consolidation.

This commit is contained in:
Stuart D. Gathman
2018-12-24 18:20:26 -05:00
parent 183ce91a61
commit 7dfda0a3bd
2 changed files with 2 additions and 15 deletions
-1
View File
@@ -10,7 +10,6 @@ include testmime.py
include testutils.py include testutils.py
include test.py include test.py
include sample.py include sample.py
include sgmllib.py
include milter-template.py include milter-template.py
include test/* include test/*
include Milter/*.py include Milter/*.py
+2 -14
View File
@@ -134,8 +134,10 @@ static struct MilterCallback {
#if PY_MAJOR_VERSION >= 3 #if PY_MAJOR_VERSION >= 3
static struct smfiDesc description; /* forward declaration */ static struct smfiDesc description; /* forward declaration */
static PyTypeObject milter_ContextType;
#else #else
staticforward struct smfiDesc description; /* forward declaration */ staticforward struct smfiDesc description; /* forward declaration */
staticforward PyTypeObject milter_ContextType;
#endif #endif
static PyObject *MilterError; static PyObject *MilterError;
@@ -148,12 +150,6 @@ typedef struct {
static milter_Diag diag; static milter_Diag diag;
#if PY_MAJOR_VERSION >= 3
static PyTypeObject milter_ContextType;
#else
staticforward PyTypeObject milter_ContextType;
#endif
typedef struct { typedef struct {
PyObject_HEAD PyObject_HEAD
SMFICTX *ctx; /* libmilter thread state */ SMFICTX *ctx; /* libmilter thread state */
@@ -772,13 +768,6 @@ milter_wrap_negotiate(SMFICTX *ctx,
rc = _generic_wrapper(c, negotiate_callback, arglist); rc = _generic_wrapper(c, negotiate_callback, arglist);
c->t = t; c->t = t;
if (rc == SMFIS_CONTINUE) { if (rc == SMFIS_CONTINUE) {
#if 0 // PyArgs_Parse deprecated and going away
if (!PyArgs_Parse(optlist,"[kkkk]",pf0,pf1,pf2,pf3)) {
PyErr_Print();
PyErr_Clear(); /* must clear since not returning to python */
rc = SMFIS_REJECT;
}
#else
unsigned long *pa[4] = { pf0,pf1,pf2,pf3 }; unsigned long *pa[4] = { pf0,pf1,pf2,pf3 };
unsigned long fa[4] = { f0,f1,f2,f3 }; unsigned long fa[4] = { f0,f1,f2,f3 };
int len = PyList_Size(optlist); int len = PyList_Size(optlist);
@@ -797,7 +786,6 @@ milter_wrap_negotiate(SMFICTX *ctx,
PyErr_Clear(); PyErr_Clear();
rc = SMFIS_REJECT; rc = SMFIS_REJECT;
} }
#endif
} }
else if (rc != SMFIS_ALL_OPTS) else if (rc != SMFIS_ALL_OPTS)
rc = SMFIS_REJECT; rc = SMFIS_REJECT;