aboutsummaryrefslogtreecommitdiff
path: root/src/buffer.hpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-09-16 10:51:58 -0400
committerAndrew Kelley <superjoe30@gmail.com>2018-09-16 10:51:58 -0400
commita2abdb185f9e47b663edce1bdfa3fa525502f321 (patch)
tree9027e6f6886937afa463563dae176e5757cf006e /src/buffer.hpp
parenta6bf37f8ca5a2eabc7cacb22696d2a2c622a993d (diff)
parent780e5674467ebac4534cd3d3f2199ccaf1d0922c (diff)
downloadzig-a2abdb185f9e47b663edce1bdfa3fa525502f321.tar.gz
zig-a2abdb185f9e47b663edce1bdfa3fa525502f321.zip
Merge remote-tracking branch 'origin/master' into llvm7
Diffstat (limited to 'src/buffer.hpp')
-rw-r--r--src/buffer.hpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/buffer.hpp b/src/buffer.hpp
index 501e44b5ac..8155df87a1 100644
--- a/src/buffer.hpp
+++ b/src/buffer.hpp
@@ -78,6 +78,10 @@ static inline Buf *buf_create_from_mem(const char *ptr, size_t len) {
return buf;
}
+static inline Buf *buf_create_from_slice(Slice<uint8_t> slice) {
+ return buf_create_from_mem((const char *)slice.ptr, slice.len);
+}
+
static inline Buf *buf_create_from_str(const char *str) {
return buf_create_from_mem(str, strlen(str));
}