Make weak symbol usage more portable:

- Enable support for Green Hills Software compiler
- Define weak implementations only once except on Windows
This commit is contained in:
John Lindgren
2017-10-09 11:38:08 -04:00
parent a7e8797e0c
commit df78aade4b
2 changed files with 3 additions and 1 deletions

View File

@ -158,7 +158,9 @@ class UnityTestRunnerGenerator
create_runtest(output, mocks)
output.puts("\n/*=======Automagically Detected Files To Include=====*/")
output.puts("#include \"#{@options[:framework]}.h\"")
output.puts('#ifdef __WIN32__')
output.puts("#include \"#{@options[:framework]}_setup.h\"")
output.puts('#endif')
output.puts('#include "cmock.h"') unless mocks.empty?
output.puts('#include <setjmp.h>')
output.puts('#include <stdio.h>')

View File

@ -301,7 +301,7 @@ extern void UNITY_OMIT_OUTPUT_FLUSH_HEADER_DECLARATION;
* Language Features Available
*-------------------------------------------------------*/
#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__)
# define UNITY_WEAK_ATTRIBUTE __attribute__((weak))
# endif