diff --git a/extras/fixture/rakefile_helper.rb b/extras/fixture/rakefile_helper.rb index 8bdb09d92d5351689796fa6b69010d4a680435a8..94a90be08b50d7b20e59af373f2c0c83d9836997 100644 --- a/extras/fixture/rakefile_helper.rb +++ b/extras/fixture/rakefile_helper.rb @@ -52,7 +52,7 @@ def build_compiler_fields defines = if $cfg['compiler']['defines']['items'].nil? '' else - squash($cfg['compiler']['defines']['prefix'], $cfg['compiler']['defines']['items'] + ['UNITY_OUTPUT_CHAR=UnityOutputCharSpy_OutputChar'] + ['UNITY_OUTPUT_CHAR_HEADER_DECLARATION=UnityOutputCharSpy_OutputChar\(int\)']) + squash($cfg['compiler']['defines']['prefix'], $cfg['compiler']['defines']['items'] + ['UNITY_OUTPUT_CHAR=UnityOutputCharSpy_OutputChar'] + ['UNITY_OUTPUT_CHAR_HEADER_DECLARATION=UnityOutputCharSpy_OutputChar(int)']) end options = squash('', $cfg['compiler']['options']) includes = squash($cfg['compiler']['includes']['prefix'], $cfg['compiler']['includes']['items']) diff --git a/extras/fixture/test/Makefile b/extras/fixture/test/Makefile index e6c62552f6f53b58e9ab2d19acc70c5db5e83bbf..b8eef21165a309dc21b082dde59575c4e1d2b914 100644 --- a/extras/fixture/test/Makefile +++ b/extras/fixture/test/Makefile @@ -6,7 +6,7 @@ endif CFLAGS += -std=c99 -pedantic -Wall -Wextra -Werror CFLAGS += $(DEBUG) DEFINES = -D UNITY_OUTPUT_CHAR=UnityOutputCharSpy_OutputChar -DEFINES += -D UNITY_OUTPUT_CHAR_HEADER_DECLARATION=UnityOutputCharSpy_OutputChar\(int\) +DEFINES += -D UNITY_OUTPUT_CHAR_HEADER_DECLARATION=UnityOutputCharSpy_OutputChar(int) SRC = ../src/unity_fixture.c \ ../../../src/unity.c \ unity_fixture_Test.c \ diff --git a/extras/fixture/test/unity_fixture_Test.c b/extras/fixture/test/unity_fixture_Test.c index da44d5d9157952b1b6ef2b742d24898819d71fee..4b59d988748a6cb027467f2ff08968284d3767d3 100644 --- a/extras/fixture/test/unity_fixture_Test.c +++ b/extras/fixture/test/unity_fixture_Test.c @@ -345,7 +345,7 @@ TEST_TEAR_DOWN(LeakDetection) /* This tricky set of defines lets us see if we are using the Spy, returns 1 if true */ #ifdef __STDC_VERSION__ -#if UNITY_SUPPORT_VARIADIC_MACROS +#ifdef UNITY_SUPPORT_VARIADIC_MACROS #define USING_SPY_AS(a) EXPAND_AND_USE_2ND(ASSIGN_VALUE(a), 0) #define ASSIGN_VALUE(a) VAL_##a #define VAL_UnityOutputCharSpy_OutputChar 0, 1 @@ -357,11 +357,13 @@ TEST_TEAR_DOWN(LeakDetection) #endif /* UNITY_SUPPORT_VARIADIC_MACROS */ #else /* __STDC_VERSION__ else */ + #define UnityOutputCharSpy_OutputChar 42 #if UNITY_OUTPUT_CHAR == UnityOutputCharSpy_OutputChar /* Works if no -Wundef -Werror */ #define USING_OUTPUT_SPY #endif #undef UnityOutputCharSpy_OutputChar + #endif /* __STDC_VERSION__ */ TEST(LeakDetection, DetectsLeak)