aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/cc/common.ixx
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2/cc/common.ixx')
-rw-r--r--libbuild2/cc/common.ixx27
1 files changed, 27 insertions, 0 deletions
diff --git a/libbuild2/cc/common.ixx b/libbuild2/cc/common.ixx
new file mode 100644
index 0000000..417efbd
--- /dev/null
+++ b/libbuild2/cc/common.ixx
@@ -0,0 +1,27 @@
+// file : libbuild2/cc/common.ixx -*- C++ -*-
+// license : MIT; see accompanying LICENSE file
+
+namespace build2
+{
+ namespace cc
+ {
+ inline const scope* data::
+ effective_iscope (const scope& bs) const
+ {
+ if (iscope)
+ {
+ switch (*iscope)
+ {
+ case internal_scope::current: return iscope_current;
+ case internal_scope::base: return &bs;
+ case internal_scope::root: return bs.root_scope ();
+ case internal_scope::bundle: return bs.bundle_scope ();
+ case internal_scope::strong: return bs.strong_scope ();
+ case internal_scope::weak: return bs.weak_scope ();
+ }
+ }
+
+ return nullptr;
+ }
+ }
+}