add Py_CHARMASK

This commit is contained in:
Guido van Rossum 1995-02-10 16:51:02 +00:00
parent cc6764c1ba
commit 10f8efd87a
1 changed files with 8 additions and 0 deletions

View File

@ -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