From ccf71c91ec5b6fad26a15ec0dd1ec31f57069934 Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Tue, 7 Jul 2020 08:12:09 -0400 Subject: [PATCH] teach expand_instantiations to deal with preprocessor defines --- cmake/scripts/expand_instantiations.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) 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; -- 2.39.5