Turn UNITY_OUTPUT_FLUSH off by default. Added a quick-define for the most common case: UNITY_USE_FLUSH_STDOUT. Clarified documentation. Fixes issue #269

This commit is contained in:
Mark VanderVoord
2017-03-14 23:23:19 -04:00
parent c67a4ffcf3
commit 8723d50f0e
3 changed files with 9 additions and 6 deletions

View File

@ -252,14 +252,19 @@ extern void UNITY_OUTPUT_CHAR(int);
#endif
#ifndef UNITY_OUTPUT_FLUSH
/* Default to using fflush, which is defined in stdio.h */
#ifdef UNITY_USE_FLUSH_STDOUT
/* We want to use the stdout flush utility */
#include <stdio.h>
#define UNITY_OUTPUT_FLUSH (void)fflush(stdout)
#else
/* If defined as something else, make sure we declare it here so it's ready for use */
#ifndef UNITY_OMIT_OUTPUT_FLUSH_HEADER_DECLARATION
/* We've specified nothing, therefore flush should just be ignored */
#define UNITY_OUTPUT_FLUSH
#endif
#else
/* We've defined flush as something else, so make sure we declare it here so it's ready for use */
#ifndef UNITY_OMIT_OUTPUT_FLUSH_HEADER_DECLARATION
extern void UNITY_OUTPUT_FLUSH(void);
#endif
#endif
#endif
#ifndef UNITY_OUTPUT_FLUSH