Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@stuvel.eu>2018-06-28 16:32:14 +0300
committerSybren A. Stüvel <sybren@stuvel.eu>2018-06-28 16:32:19 +0300
commitd2757d149bf2d9ac604da6fb7f4742ee77e68d2d (patch)
tree0fa5d57277a8a22a68c895394592e177667f7b2b /source/creator/creator.c
parent747843516f3c1e3f3f576464d97f2e82981cc436 (diff)
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.
Diffstat (limited to 'source/creator/creator.c')
-rw-r--r--source/creator/creator.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/creator/creator.c b/source/creator/creator.c
index bda97fba863..076d55d3a11 100644
--- a/source/creator/creator.c
+++ b/source/creator/creator.c
@@ -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)