From 03eeea3b6c083ec9f9e755a2505d559b70c6cf0d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 10 Feb 2022 07:35:19 +0200 Subject: Reorder inline function definition to help with MinGW GCC symbol export --- libbuild2/scope.hxx | 29 +---------------------------- libbuild2/scope.ixx | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 28 deletions(-) diff --git a/libbuild2/scope.hxx b/libbuild2/scope.hxx index 2df8f0a..75c0711 100644 --- a/libbuild2/scope.hxx +++ b/libbuild2/scope.hxx @@ -431,34 +431,7 @@ namespace build2 // template void - insert_rule (meta_operation_id mid, operation_id oid, - string hint, - const rule& r) - { - if (mid != 0) - rules.insert (mid, oid, move (hint), r); - else - { - auto& ms (root_scope ()->root_extra->meta_operations); - - for (size_t i (1), n (ms.size ()); i != n; ++i) - { - if (ms[i] != nullptr) - { - // Skip a few well-known meta-operations that cannot possibly - // trigger a rule match. - // - mid = static_cast (i); - - if (mid != noop_id && - mid != info_id && - mid != create_id && - mid != disfigure_id) - rules.insert (mid, oid, hint, r); - } - } - } - } + insert_rule (meta_operation_id, operation_id, string hint, const rule&); // Operation callbacks. // diff --git a/libbuild2/scope.ixx b/libbuild2/scope.ixx index e123e4a..d297720 100644 --- a/libbuild2/scope.ixx +++ b/libbuild2/scope.ixx @@ -173,6 +173,37 @@ namespace build2 this}; } + template + inline void scope:: + insert_rule (meta_operation_id mid, operation_id oid, + string hint, + const rule& r) + { + if (mid != 0) + rules.insert (mid, oid, move (hint), r); + else + { + auto& ms (root_scope ()->root_extra->meta_operations); + + for (size_t i (1), n (ms.size ()); i != n; ++i) + { + if (ms[i] != nullptr) + { + // Skip a few well-known meta-operations that cannot possibly + // trigger a rule match. + // + mid = static_cast (i); + + if (mid != noop_id && + mid != info_id && + mid != create_id && + mid != disfigure_id) + rules.insert (mid, oid, hint, r); + } + } + } + } + inline dir_path src_out (const dir_path& out, const scope& r) { -- cgit v1.1