Staging
v0.5.0
https://github.com/python/cpython
Raw File
Tip revision: 4b37228823fecb73fe70dc009e696a7805b0833f authored by Ethan Furman on 08 December 2020, 22:29:02 UTC
[3.9] [Enum] reformat and add doc strings (GH-23705). (GH-23707)
Tip revision: 4b37228
bitset.h

#ifndef Py_BITSET_H
#define Py_BITSET_H
#ifdef __cplusplus
extern "C" {
#endif

/* Bitset interface */

#define BYTE            char
typedef BYTE *bitset;

#define testbit(ss, ibit) (((ss)[BIT2BYTE(ibit)] & BIT2MASK(ibit)) != 0)

#define BITSPERBYTE     (8*sizeof(BYTE))
#define BIT2BYTE(ibit)  ((ibit) / BITSPERBYTE)
#define BIT2SHIFT(ibit) ((ibit) % BITSPERBYTE)
#define BIT2MASK(ibit)  (1 << BIT2SHIFT(ibit))

#ifdef __cplusplus
}
#endif
#endif /* !Py_BITSET_H */
back to top