static Py_hash_t fe_pyhash(PyObject *me)
{ return (mphash(FE_X(me))); }
+#ifdef PY2
static int fe_pycoerce(PyObject **x, PyObject **y)
{
mp *z;
end:
return (-1);
}
+#endif
static PyObject *fe_pyint(PyObject *x)
{
return (rc);
}
+#ifdef PY2
static PyObject *fe_pylong(PyObject *x)
{
mp *xx = F_OUT(FE_F(x), MP_NEW, FE_X(x));
MP_DROP(xx);
return (rc);
}
+#endif
#define BASEOP(name, radix, pre) \
static PyObject *fe_py##name(PyObject *x) { \
MP_DROP(xx); \
return (rc); \
}
+#ifdef PY2
BASEOP(oct, 8, "0");
+#endif
BASEOP(hex, 16, "0x");
#undef BASEOP
static const PyMemberDef fe_pymembers[] = {
#define MEMBERSTRUCT fe_pyobj
- MEMRNM(field, T_OBJECT, ob_type, READONLY,
+ MEMRNM(field, T_OBJECT, PY23(ob_type, ob_base.ob_type), READONLY,
"X.field -> field containing X")
#undef MEMBERSTRUCT
{ 0 }
fe_pyadd, /* @nb_add@ */
fe_pysub, /* @nb_subtract@ */
fe_pymul, /* @nb_multiply@ */
+#ifdef PY2
fe_pydiv, /* @nb_divide@ */
+#endif
0, /* @nb_remainder@ */
0, /* @nb_divmod@ */
fe_pyexp, /* @nb_power@ */
0, /* @nb_and@ */
0, /* @nb_xor@ */
0, /* @nb_or@ */
+#ifdef PY2
fe_pycoerce, /* @nb_coerce@ */
+#endif
fe_pyint, /* @nb_int@ */
- fe_pylong, /* @nb_long@ */
+ PY23(fe_pylong, 0), /* @nb_long@ */
0 /* meaningless */, /* @nb_float@ */
+#ifdef PY2
fe_pyoct, /* @nb_oct@ */
fe_pyhex, /* @nb_hex@ */
+#endif
0, /* @nb_inplace_add@ */
0, /* @nb_inplace_subtract@ */
0, /* @nb_inplace_multiply@ */
+#ifdef PY2
0, /* @nb_inplace_divide@ */
+#endif
0, /* @nb_inplace_remainder@ */
0, /* @nb_inplace_power@ */
0, /* @nb_inplace_lshift@ */