Last active
December 21, 2015 00:28
-
-
Save OdNairy/6219906 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Source: https://devforums.apple.com/message/866487#866487 | |
typedef int (*PYStdWriter)(void *, const char *, int); | |
static PYStdWriter _oldStdWrite; | |
int __pyStderrWrite(void *inFD, const char *buffer, int size) | |
{ | |
if ( strncmp(buffer, "AssertMacros: queueEntry", 24) == 0 ) { | |
return 0; | |
} | |
return _oldStdWrite(inFD, buffer, size); | |
} | |
void __iOS7B5CleanConsoleOutput(void) | |
{ | |
_oldStdWrite = stderr->_write; | |
stderr->_write = __pyStderrWrite; | |
} | |
int main(int argc, char *argv[]) | |
{ | |
@autoreleasepool { | |
__iOS7B5CleanConsoleOutput(); | |
return UIApplicationMain(argc, argv, nil, NSStringFromClass([DBAppDelegate class])); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was getting warnings for “no previous prototype for function” and had to define function prototypes at the top of the class. I added this after line 3:
int __pyStderrWrite(void *inFD, const char *buffer, int size);
void __iOS7B5CleanConsoleOutput(void);