From: Mark Wooding Date: Sun, 20 Oct 2019 22:18:09 +0000 (+0100) Subject: *.c: Split the constant definitions into the various submodules. X-Git-Url: https://git.distorted.org.uk/~mdw/pyke/commitdiff_plain/d53428cdbb18e94ee2941ab44936584c9ac3f4dd *.c: Split the constant definitions into the various submodules. --- diff --git a/pyke.h b/pyke.h index 138a9fb..64608d9 100644 --- a/pyke.h +++ b/pyke.h @@ -321,6 +321,8 @@ extern PyObject *mkexc(PyObject */*mod*/, PyObject */*base*/, struct nameval { const char *name; unsigned f; unsigned long value; }; #define CF_SIGNED 1u extern void setconstants(PyObject *, const struct nameval *); +#define CONST(x) { #x, (x) >= 0 ? 0 : CF_SIGNED, x } +#define CONSTFLAG(f, x) { #x, f, x } #define INSEXC(name, var, base, meth) \ INSERT(name, var = mkexc(mod, base, name, meth))