aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/functions-bool.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-12-14 08:03:32 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-12-14 08:03:32 +0200
commit218a739b33325c5dd6baa5cf6291dad849ad2441 (patch)
tree754661d712d80d87c1c113cb7bfd6ec542e5858b /libbuild2/functions-bool.cxx
parent6d892e32a83908406a6f2fc6d47dd4a8b131fc60 (diff)
Handle NULL values in $string() and $concat() functions
This is relied upon by the parser to provide conversion/concatenation semantics consistent with untyped values. Note that we handle NULL values only for types that have empty representation.
Diffstat (limited to 'libbuild2/functions-bool.cxx')
-rw-r--r--libbuild2/functions-bool.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/libbuild2/functions-bool.cxx b/libbuild2/functions-bool.cxx
index 1ae89d2..1d9c72f 100644
--- a/libbuild2/functions-bool.cxx
+++ b/libbuild2/functions-bool.cxx
@@ -15,6 +15,9 @@ namespace build2
// $string(<bool>)
//
+ // Note that we don't handle NULL values for this type since it has no
+ // empty representation.
+ //
f["string"] += [](bool b) {return b ? "true" : "false";};
}
}