From f02bb058bddd6240f1bda49a11f5224af92e466c Mon Sep 17 00:00:00 2001 From: Jeremy White Date: Fri, 27 Oct 2017 02:46:56 -0500 Subject: [PATCH] Set the llvm standard output stream to be unbuffered. (#678) This is particularly useful for the simulation when invokved inside Eclipse. Otherwise, you won't see the robot starting message. --- hal/src/main/native/athena/HAL.cpp | 1 + hal/src/main/native/sim/HAL.cpp | 3 +++ 2 files changed, 4 insertions(+) diff --git a/hal/src/main/native/athena/HAL.cpp b/hal/src/main/native/athena/HAL.cpp index ac84792f81..798c99639b 100644 --- a/hal/src/main/native/athena/HAL.cpp +++ b/hal/src/main/native/athena/HAL.cpp @@ -342,6 +342,7 @@ HAL_Bool HAL_Initialize(int32_t timeout, int32_t mode) { setlinebuf(stdin); setlinebuf(stdout); + llvm::outs().SetUnbuffered(); prctl(PR_SET_PDEATHSIG, SIGTERM); diff --git a/hal/src/main/native/sim/HAL.cpp b/hal/src/main/native/sim/HAL.cpp index a9f08a1d83..b69455a4ef 100644 --- a/hal/src/main/native/sim/HAL.cpp +++ b/hal/src/main/native/sim/HAL.cpp @@ -7,6 +7,8 @@ #include "HAL/HAL.h" +#include + #include "ErrorsInternal.h" #include "HAL/DriverStation.h" #include "HAL/Errors.h" @@ -204,6 +206,7 @@ HAL_Bool HAL_Initialize(int32_t timeout, int32_t mode) { // Second check in case another thread was waiting if (initialized) return true; + llvm::outs().SetUnbuffered(); if (HAL_LoadExtensions() < 0) return false; hal::RestartTiming(); HAL_InitializeDriverStation();