From 9578a382ccf5339bb75289a0be2d07e234c93ee0 Mon Sep 17 00:00:00 2001 From: John Lindgren Date: Fri, 13 Sep 2019 16:19:46 -0400 Subject: [PATCH] Fix "rake scripts" when running on Windows. cmd.exe does not recognize backslash as an escape character, leading to errors like the following: error: stray '\' in program note: in definition of macro 'UNITY_OUTPUT_CHAR_HEADER_DECLARATION' It does, however, recognize double quotes, so we can use those as a portable method of escaping special characters on both Windows and UNIX. --- test/rakefile_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/rakefile_helper.rb b/test/rakefile_helper.rb index 97c416f..7106868 100644 --- a/test/rakefile_helper.rb +++ b/test/rakefile_helper.rb @@ -91,7 +91,7 @@ module RakefileHelpers defines = if $cfg['compiler']['defines']['items'].nil? '' else - squash($cfg['compiler']['defines']['prefix'], $cfg['compiler']['defines']['items'] + ['UNITY_OUTPUT_CHAR=putcharSpy'] + ['UNITY_OUTPUT_CHAR_HEADER_DECLARATION=putcharSpy\(int\)'] + inject_defines) + squash($cfg['compiler']['defines']['prefix'], $cfg['compiler']['defines']['items'] + ['UNITY_OUTPUT_CHAR=putcharSpy'] + ['UNITY_OUTPUT_CHAR_HEADER_DECLARATION="putcharSpy(int)"'] + inject_defines) end options = squash('', $cfg['compiler']['options']) includes = squash($cfg['compiler']['includes']['prefix'], $cfg['compiler']['includes']['items']) -- GitLab