程序出现AssertMacros: queueEntry, file: /SourceCache/IOKitUser/IOKitUser-920.1.11/hid.subproj/IOHIDEventQueue.c, line: 512的解决办法

出现AssertMacros: queueEntry, file: /SourceCache/IOKitUser/IOKitUser-920.1.11/hid.subproj/IOHIDEventQueue.c, line: 512时,
修改main.m,添加如下代码

typedef int (*PYStdWriter)(void *, const char *, int);
static PYStdWriter _oldStdWrite;

int __pyStderrWrite(void *inFD, const char *buffer, int size)
{
        if ( strncmp(buffer, "AssertMacros:", 13) == 0 ) {
                return 0;
        }
        return _oldStdWrite(inFD, buffer, size);
}

然后在main()中的
@autoreleasepool
前添加
    _oldStdWrite = stderr->_write;
    stderr->_write = __pyStderrWrite;

This passage is moved from ra1ndrops.com. I will not longer use that domain, so I import it here.

声明: 本文为0xBBC原创, 转载注明出处喵~

发表评论

电子邮件地址不会被公开。 必填项已用*标注