Make stdout unbuffered

Unbuffered stdout makes stdout and stderr better synchronised, and helps
when stepping through code in a debugger (prints are immediately
visible). We don't output much to stdout anyway, so this isn't likely to
cause any performance issues.
This commit is contained in:
Sybren A. Stüvel 2018-06-28 15:32:14 +02:00
parent 747843516f
commit d2757d149b

@ -236,6 +236,11 @@ int main(
struct CreatorAtExitData app_init_data = {NULL};
BKE_blender_atexit_register(callback_main_atexit, &app_init_data);
/* Unbuffered stdout makes stdout and stderr better synchronised, and helps
* when stepping through code in a debugger (prints are immediately
* visible). */
setbuffer(stdout, NULL, 0);
#ifdef WIN32
/* We delay loading of openmp so we can set the policy here. */
# if defined(_MSC_VER)