From bf959a7fc119f9156c4b84c9d0a10900d9153f8d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 27 Jul 2017 14:45:05 +0200 Subject: Initial infrastructure for utility libraries --- build2/cc/utility.ixx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'build2/cc/utility.ixx') diff --git a/build2/cc/utility.ixx b/build2/cc/utility.ixx index d372dac..d13a0ff 100644 --- a/build2/cc/utility.ixx +++ b/build2/cc/utility.ixx @@ -17,15 +17,19 @@ namespace build2 otype::s; } - inline otype + inline ltype link_type (const target& t) { using namespace bin; - return - t.is_a () ? otype::e : - t.is_a () ? otype::a : - otype::s; + bool u (false); + otype o ( + t.is_a () || (u = t.is_a ()) ? otype::e : + t.is_a () || (u = t.is_a ()) ? otype::a : + t.is_a () || (u = t.is_a ()) ? otype::s : + static_cast (0xFF)); + + return ltype {o, u}; } inline compile_target_types -- cgit v1.1