summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1995-02-10 16:51:02 (GMT)
committerGuido van Rossum <guido@python.org>1995-02-10 16:51:02 (GMT)
commit10f8efd87add5850c54cad74353d42c03e903aae (patch)
treec303ff374d5419814dbcbce9c0af921a3d33ccc5 /Include
parentcc6764c1ba92e947638d1c0c8fe8d312a0e3e6d4 (diff)
downloadcpython-10f8efd87add5850c54cad74353d42c03e903aae.zip
cpython-10f8efd87add5850c54cad74353d42c03e903aae.tar.gz
cpython-10f8efd87add5850c54cad74353d42c03e903aae.tar.bz2
add Py_CHARMASK
Diffstat (limited to 'Include')
-rw-r--r--Include/allobjects.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/Include/allobjects.h b/Include/allobjects.h
index 5ce324d..34b3816 100644
--- a/Include/allobjects.h
+++ b/Include/allobjects.h
@@ -82,6 +82,14 @@ extern void Py_FatalError Py_PROTO((char *));
#define PyArg_GetInt(v, a) PyArg_Parse((v), "i", (a))
#define PyArg_NoArgs(v) PyArg_Parse(v, "")
+/* Convert a possibly signed character to a nonnegative int */
+/* XXX This assumes characters are 8 bits wide */
+#ifdef __CHAR_UNSIGNED__
+#define Py_CHARMASK(c) (c)
+#else
+#define Py_CHARMASK(c) ((c) & 0xff)
+#endif
+
#ifdef __cplusplus
}
#endif