提交 593a0346 编写于 作者: J jsalling

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.
上级 57348172
......@@ -6,4 +6,4 @@ script:
- cd test && rake ci
- make -s
- cd ../extras/fixture/test && rake ci
- make -s default noStdLibMalloc
- make -s default noStdlibMalloc
......@@ -7,6 +7,9 @@
#include "unity.h"
#include <stddef.h>
#ifdef UNITY_OMIT_OUTPUT_CHAR_HEADER_DECLARATION
int UNITY_OUTPUT_CHAR(int); //If omitted from header, declare it here so it's ready for use
#endif
#define UNITY_FAIL_AND_BAIL { Unity.CurrentTestFailed = 1; longjmp(Unity.AbortFrame, 1); }
#define UNITY_IGNORE_AND_BAIL { Unity.CurrentTestIgnored = 1; longjmp(Unity.AbortFrame, 1); }
/// return prematurely if we are already in failure or ignore state
......
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册