mirror of
https://github.com/ThrowTheSwitch/CMock.git
synced 2026-06-05 21:15:20 +00:00
Merge pull request #149 from SteinHeselmans/master
fix #147: Push and Pop pragmas not supported by older GCC
This commit is contained in:
@@ -103,7 +103,9 @@ class CMockGenerator
|
||||
file << "\n"
|
||||
file << "/* Ignore the following warnings, since we are copying code */\n"
|
||||
file << "#if defined(__GNUC__) && !defined(__ICC) && !defined(__TMS470__)\n"
|
||||
file << "#if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ > 6 || (__GNUC_MINOR__ == 6 && __GNUC_PATCHLEVEL__ > 0)))\n"
|
||||
file << "#pragma GCC diagnostic push\n"
|
||||
file << "#endif\n"
|
||||
file << "#if !defined(__clang__)\n"
|
||||
file << "#pragma GCC diagnostic ignored \"-Wpragmas\"\n"
|
||||
file << "#endif\n"
|
||||
@@ -128,8 +130,10 @@ class CMockGenerator
|
||||
def create_mock_header_footer(header)
|
||||
header << "\n"
|
||||
header << "#if defined(__GNUC__) && !defined(__ICC) && !defined(__TMS470__)\n"
|
||||
header << "#if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ > 6 || (__GNUC_MINOR__ == 6 && __GNUC_PATCHLEVEL__ > 0)))\n"
|
||||
header << "#pragma GCC diagnostic pop\n"
|
||||
header << "#endif\n"
|
||||
header << "#endif\n"
|
||||
header << "\n"
|
||||
header << "#endif\n"
|
||||
end
|
||||
|
||||
@@ -100,7 +100,9 @@ describe CMockGenerator, "Verify CMockGenerator Module" do
|
||||
"\n",
|
||||
"/* Ignore the following warnings, since we are copying code */\n",
|
||||
"#if defined(__GNUC__) && !defined(__ICC) && !defined(__TMS470__)\n",
|
||||
"#if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ > 6 || (__GNUC_MINOR__ == 6 && __GNUC_PATCHLEVEL__ > 0)))\n",
|
||||
"#pragma GCC diagnostic push\n",
|
||||
"#endif\n",
|
||||
"#if !defined(__clang__)\n",
|
||||
"#pragma GCC diagnostic ignored \"-Wpragmas\"\n",
|
||||
"#endif\n",
|
||||
@@ -154,7 +156,9 @@ describe CMockGenerator, "Verify CMockGenerator Module" do
|
||||
"\n",
|
||||
"/* Ignore the following warnings, since we are copying code */\n",
|
||||
"#if defined(__GNUC__) && !defined(__ICC) && !defined(__TMS470__)\n",
|
||||
"#if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ > 6 || (__GNUC_MINOR__ == 6 && __GNUC_PATCHLEVEL__ > 0)))\n",
|
||||
"#pragma GCC diagnostic push\n",
|
||||
"#endif\n",
|
||||
"#if !defined(__clang__)\n",
|
||||
"#pragma GCC diagnostic ignored \"-Wpragmas\"\n",
|
||||
"#endif\n",
|
||||
@@ -190,7 +194,9 @@ describe CMockGenerator, "Verify CMockGenerator Module" do
|
||||
"\n",
|
||||
"/* Ignore the following warnings, since we are copying code */\n",
|
||||
"#if defined(__GNUC__) && !defined(__ICC) && !defined(__TMS470__)\n",
|
||||
"#if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ > 6 || (__GNUC_MINOR__ == 6 && __GNUC_PATCHLEVEL__ > 0)))\n",
|
||||
"#pragma GCC diagnostic push\n",
|
||||
"#endif\n",
|
||||
"#if !defined(__clang__)\n",
|
||||
"#pragma GCC diagnostic ignored \"-Wpragmas\"\n",
|
||||
"#endif\n",
|
||||
@@ -227,7 +233,9 @@ describe CMockGenerator, "Verify CMockGenerator Module" do
|
||||
"\n",
|
||||
"/* Ignore the following warnings, since we are copying code */\n",
|
||||
"#if defined(__GNUC__) && !defined(__ICC) && !defined(__TMS470__)\n",
|
||||
"#if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ > 6 || (__GNUC_MINOR__ == 6 && __GNUC_PATCHLEVEL__ > 0)))\n",
|
||||
"#pragma GCC diagnostic push\n",
|
||||
"#endif\n",
|
||||
"#if !defined(__clang__)\n",
|
||||
"#pragma GCC diagnostic ignored \"-Wpragmas\"\n",
|
||||
"#endif\n",
|
||||
@@ -281,8 +289,10 @@ describe CMockGenerator, "Verify CMockGenerator Module" do
|
||||
output = []
|
||||
expected = ["\n",
|
||||
"#if defined(__GNUC__) && !defined(__ICC) && !defined(__TMS470__)\n",
|
||||
"#if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ > 6 || (__GNUC_MINOR__ == 6 && __GNUC_PATCHLEVEL__ > 0)))\n",
|
||||
"#pragma GCC diagnostic pop\n",
|
||||
"#endif\n",
|
||||
"#endif\n",
|
||||
"\n",
|
||||
"#endif\n"
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user