-
-
Save louisbl/3832164 to your computer and use it in GitHub Desktop.
Patch for HXCPP (r559) to disable buffering on standard out (fixes the issue regarding traces displayed at process exit)
This file contains hidden or 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
Index: include/hx/StdLibs.h | |
=================================================================== | |
--- include/hx/StdLibs.h (revision 559) | |
+++ include/hx/StdLibs.h (working copy) | |
@@ -32,6 +32,7 @@ | |
void __hxcpp_print(Dynamic &inV); | |
void __hxcpp_println(Dynamic &inV); | |
void __trace(Dynamic inPtr, Dynamic inData); | |
+void __hxcpp_stdlibs_boot(); | |
// --- Maths --------------------------------------------------------- | |
double __hxcpp_drand(); | |
Index: src/hx/StdLibs.cpp | |
=================================================================== | |
--- src/hx/StdLibs.cpp (revision 559) | |
+++ src/hx/StdLibs.cpp (working copy) | |
@@ -126,6 +126,12 @@ | |
return (lo | (mid<<12) | (hi<<24) ) % inMax; | |
} | |
+void __hxcpp_stdlibs_boot() | |
+{ | |
+ // Disables standard output buffering. | |
+ setbuf(stdout, NULL); | |
+} | |
+ | |
void __trace(Dynamic inObj, Dynamic inData) | |
{ | |
#ifdef HX_UTF8_STRINGS | |
Index: src/hx/Boot.cpp | |
=================================================================== | |
--- src/hx/Boot.cpp (revision 559) | |
+++ src/hx/Boot.cpp (working copy) | |
@@ -13,7 +13,7 @@ | |
setvbuf( stderr , 0 , _IONBF , 0 ); | |
#endif | |
- | |
+ __hxcpp_stdlibs_boot(); | |
Object::__boot(); | |
Dynamic::__boot(); | |
Class_obj::__boot(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment