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

Binary file not shown.

View File

@ -252,14 +252,19 @@ extern void UNITY_OUTPUT_CHAR(int);
#endif #endif
#ifndef UNITY_OUTPUT_FLUSH #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> #include <stdio.h>
#define UNITY_OUTPUT_FLUSH (void)fflush(stdout) #define UNITY_OUTPUT_FLUSH (void)fflush(stdout)
#else #else
/* If defined as something else, make sure we declare it here so it's ready for use */ /* We've specified nothing, therefore flush should just be ignored */
#ifndef UNITY_OMIT_OUTPUT_FLUSH_HEADER_DECLARATION #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); extern void UNITY_OUTPUT_FLUSH(void);
#endif #endif
#endif #endif
#ifndef UNITY_OUTPUT_FLUSH #ifndef UNITY_OUTPUT_FLUSH

View File

@ -55,8 +55,6 @@ compiler:
- UNITY_INCLUDE_DOUBLE - UNITY_INCLUDE_DOUBLE
- UNITY_SUPPORT_TEST_CASES - UNITY_SUPPORT_TEST_CASES
- UNITY_SUPPORT_64 - UNITY_SUPPORT_64
- UNITY_OUTPUT_FLUSH
- UNITY_OMIT_OUTPUT_FLUSH_HEADER_DECLARATION
object_files: object_files:
prefix: '-o' prefix: '-o'
extension: '.o' extension: '.o'