(restype)
Return whether a method returning the given type must be called using ``objc_msgSend_stret``
    on the current system.
Return whether a method returning the given type must be called using ``objc_msgSend_stret``
    on the current system.
Return whether a method returning the given type must be called using objc_msgSend_stret on the current system .
def should_use_stret(restype):
    """Return whether a method returning the given type must be called using ``objc_msgSend_stret``
    on the current system.
    """

    if type(restype) != type(Structure):
        # Not needed when restype is not a structure.
        return False
    elif __i386__:
        # On i386: Use for structures not sized exactly like an integer (1, 2, 4, or 8 bytes).
        return sizeof(restype) not in (1, 2, 4, 8)
    elif __x86_64__:
        # On x86_64: Use for structures larger than 16 bytes.
        # (The ABI docs say that there are some special cases
        # for vector types, but those can't really be used
        # with ctypes anyway.)
        return sizeof(restype) > 16
    elif __arm__:
        # On ARM32: Use for all structures, regardless of size.
        return True
    else:
        # Other platforms: Doesn't exist.
        return False
def should_use_stret ( restype ) : if type ( restype ) != type ( Structure ) : # Not needed when restype is not a structure. return False elif __i386__ : # On i386: Use for structures not sized exactly like an integer (1, 2, 4, or 8 bytes). return sizeof ( restype ) not in ( 1 , 2 , 4 , 8 ) elif __x86_64__ : # On x86_64: Use for structures larger than 16 bytes. # (The ABI docs say that there are some special cases # for vector types, but those can't really be used # with ctypes anyway.) return sizeof ( restype ) > 16 elif __arm__ : # On ARM32: Use for all structures, regardless of size. return True else : # Other platforms: Doesn't exist. return False