import ctypes


def destructor(cfunc):
    """
    Make a C function a destructor.

    Destructors accept pointers to void pointers as argument. They are also wrapped as a staticmethod for usage in
    classes.

    :param cfunc: The C function as imported by ctypes.
    :return: The configured destructor.
    """
    cfunc.argtypes = [ctypes.POINTER(ctypes.c_void_p)]
    cfunc.restype = None
    return staticmethod(cfunc)