aboutsummaryrefslogtreecommitdiff
path: root/libbutl/target-triplet.cxx
diff options
context:
space:
mode:
authormagenbluten <mb@64k.by>2020-06-16 16:56:09 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-06-18 12:53:01 +0200
commit639ff12af754d024a562925a52406ace0d3c673b (patch)
tree8eb6db32cb99a6ab659440c5bb5e3f66ad86e34b /libbutl/target-triplet.cxx
parente1da4d682173d6adbc0e5c99ec1b3c8c9a948957 (diff)
Add NetBSD compatibility
Diffstat (limited to 'libbutl/target-triplet.cxx')
-rw-r--r--libbutl/target-triplet.cxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/libbutl/target-triplet.cxx b/libbutl/target-triplet.cxx
index 822461b..8eb6de6 100644
--- a/libbutl/target-triplet.cxx
+++ b/libbutl/target-triplet.cxx
@@ -60,8 +60,9 @@ namespace butl
//
string::size_type p (s.find ('-', ++f)), n (p - f);
- if (n == 0)
- bad ("empty vendor");
+ if (n == 0) {
+ goto netbsd_empty_vendor;
+ }
// Do we have all four components? If so, then we don't need to do any
// special recognition of two-component systems.
@@ -102,6 +103,8 @@ namespace butl
}
}
+netbsd_empty_vendor:
+
// (l, npos) is SYSTEM
//
system.assign (s, ++l, string::npos);
@@ -109,6 +112,11 @@ namespace butl
if (system.empty ())
bad ("missing os/kernel/abi");
+ if (system.compare(0, 6, "netbsd") == 0)
+ vendor.assign("unknown");
+ else
+ bad("empty vendor");
+
if (system.front () == '-' || system.back () == '-')
bad ("invalid os/kernel/abi");