From cd11c1a73ff823a088ab212f63f08db99be8a524 Mon Sep 17 00:00:00 2001 From: Iustin Pop Date: Sat, 28 Jun 2014 22:35:32 +0200 Subject: [PATCH] Simplify a bit the module initialization A few constants are more nicely defined. --- acl.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/acl.c b/acl.c index 4811b39..d037628 100644 --- a/acl.c +++ b/acl.c @@ -1843,17 +1843,15 @@ void initposix1e(void) PyModule_AddIntConstant(m, "ACL_MISS_ERROR", ACL_MISS_ERROR); PyModule_AddIntConstant(m, "ACL_ENTRY_ERROR", ACL_ENTRY_ERROR); - /* declare the Linux extensions */ - PyModule_AddIntConstant(m, "HAS_ACL_FROM_MODE", 1); - PyModule_AddIntConstant(m, "HAS_ACL_CHECK", 1); - PyModule_AddIntConstant(m, "HAS_EXTENDED_CHECK", 1); - PyModule_AddIntConstant(m, "HAS_EQUIV_MODE", 1); +#define LINUX_EXT_VAL 1 #else - PyModule_AddIntConstant(m, "HAS_ACL_FROM_MODE", 0); - PyModule_AddIntConstant(m, "HAS_ACL_CHECK", 0); - PyModule_AddIntConstant(m, "HAS_EXTENDED_CHECK", 0); - PyModule_AddIntConstant(m, "HAS_EQUIV_MODE", 0); +#define LINUX_EXT_VAL 0 #endif + /* declare the Linux extensions */ + PyModule_AddIntConstant(m, "HAS_ACL_FROM_MODE", LINUX_EXT_VAL); + PyModule_AddIntConstant(m, "HAS_ACL_CHECK", LINUX_EXT_VAL); + PyModule_AddIntConstant(m, "HAS_EXTENDED_CHECK", LINUX_EXT_VAL); + PyModule_AddIntConstant(m, "HAS_EQUIV_MODE", LINUX_EXT_VAL); #ifdef IS_PY3K return m; -- 2.39.5