ctypes reimplementation of rshift for c_ulong
问题 i am accessing a C library via ctypes and i am stuck with the following problem: I am generating a "wrapper" (ctypes commands to access the library with ctypes) using ctypeslib. The C library contains macros which are converted to python functions in this step. (To be independent of the libraries internals as much as possible i want to use some of these macros in python.) One of these macros looks like this: # using the ctypes types myuint16_t = c_ushort myuint32_t = c_ulong def mymacro(x):