提交 df78aade 编写于 作者: J John Lindgren

Make weak symbol usage more portable:

- Enable support for Green Hills Software compiler
- Define weak implementations only once except on Windows
上级 a7e8797e
...@@ -158,7 +158,9 @@ class UnityTestRunnerGenerator ...@@ -158,7 +158,9 @@ class UnityTestRunnerGenerator
create_runtest(output, mocks) create_runtest(output, mocks)
output.puts("\n/*=======Automagically Detected Files To Include=====*/") output.puts("\n/*=======Automagically Detected Files To Include=====*/")
output.puts("#include \"#{@options[:framework]}.h\"") output.puts("#include \"#{@options[:framework]}.h\"")
output.puts('#ifdef __WIN32__')
output.puts("#include \"#{@options[:framework]}_setup.h\"") output.puts("#include \"#{@options[:framework]}_setup.h\"")
output.puts('#endif')
output.puts('#include "cmock.h"') unless mocks.empty? output.puts('#include "cmock.h"') unless mocks.empty?
output.puts('#include <setjmp.h>') output.puts('#include <setjmp.h>')
output.puts('#include <stdio.h>') output.puts('#include <stdio.h>')
......
...@@ -301,7 +301,7 @@ extern void UNITY_OMIT_OUTPUT_FLUSH_HEADER_DECLARATION; ...@@ -301,7 +301,7 @@ extern void UNITY_OMIT_OUTPUT_FLUSH_HEADER_DECLARATION;
* Language Features Available * Language Features Available
*-------------------------------------------------------*/ *-------------------------------------------------------*/
#if !defined(UNITY_WEAK_ATTRIBUTE) && !defined(UNITY_WEAK_PRAGMA) #if !defined(UNITY_WEAK_ATTRIBUTE) && !defined(UNITY_WEAK_PRAGMA)
# ifdef __GNUC__ /* includes clang */ # if defined(__GNUC__) || defined(__ghs__) /* __GNUC__ includes clang */
# if !(defined(__WIN32__) && defined(__clang__)) && !defined(__TMS470__) # if !(defined(__WIN32__) && defined(__clang__)) && !defined(__TMS470__)
# define UNITY_WEAK_ATTRIBUTE __attribute__((weak)) # define UNITY_WEAK_ATTRIBUTE __attribute__((weak))
# endif # endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册