From: Timo Heister Date: Tue, 7 Jul 2020 12:12:09 +0000 (-0400) Subject: teach expand_instantiations to deal with preprocessor defines X-Git-Tag: v9.3.0-rc1~1324^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F10660%2Fhead;p=dealii.git teach expand_instantiations to deal with preprocessor defines --- diff --git a/cmake/scripts/expand_instantiations.cc b/cmake/scripts/expand_instantiations.cc index 246ff2502e..0b91fc2e91 100644 --- a/cmake/scripts/expand_instantiations.cc +++ b/cmake/scripts/expand_instantiations.cc @@ -439,7 +439,17 @@ process_instantiations() // for (X:Y; A:B) { INST } while (whole_file.size() != 0) { + // skip space, tabs, comments: skip_space(whole_file); + + // output preprocessor defines as is: + if (has_prefix(whole_file, "#")) + { + std::cout << get_substring_with_delim(whole_file, "\n") << '\n'; + skip_space(whole_file); + continue; + } + if (!has_prefix(whole_file, "for")) { std::cerr << "Invalid instantiation list: missing 'for'" << std::endl;