Add an option to omit UNITY_OUTPUT_CHAR declaration from the header

This solves the warnings from -Wredundant-decls when overriding the
  OUTPUT function with a function declared in another header.
 It's better this is the non-default option, since using it requires either
  a declaration of the new function OR a preprocessor guard on declaring
  UNITY_OUTPUT_CHAR (as in unity.c here), in every file using the function.
 See Pull Request #185 for more.
This commit is contained in:
jsalling
2016-04-24 12:28:46 -05:00
parent 573481729b
commit 593a03462e
3 changed files with 6 additions and 1 deletions

View File

@ -293,7 +293,9 @@ typedef UNITY_DOUBLE_TYPE _UD;
#define UNITY_OUTPUT_CHAR(a) putchar(a)
#else
//If defined as something else, make sure we declare it here so it's ready for use
#ifndef UNITY_OMIT_OUTPUT_CHAR_HEADER_DECLARATION
extern int UNITY_OUTPUT_CHAR(int);
#endif
#endif
#ifndef UNITY_PRINT_EOL