diff options
author | Kacper Michajłow <kasper93@gmail.com> | 2024-03-17 17:46:53 +0100 |
---|---|---|
committer | Kacper Michajłow <kasper93@gmail.com> | 2024-04-07 20:23:04 +0200 |
commit | fbc5e47e00252f64ae854d061af9f21a50e6d88f (patch) | |
tree | 766c2f3b7e530445725f596a2442e0a5da110040 /misc/bstr.h | |
parent | 39d560676f36d0ac5f01846abee50812e2c69f5a (diff) | |
download | mpv-fbc5e47e00252f64ae854d061af9f21a50e6d88f.tar.bz2 mpv-fbc5e47e00252f64ae854d061af9f21a50e6d88f.tar.xz |
misc/bstr: add bstr0_s for static initialization
Diffstat (limited to 'misc/bstr.h')
-rw-r--r-- | misc/bstr.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/misc/bstr.h b/misc/bstr.h index 3da4f1639f..482faa661e 100644 --- a/misc/bstr.h +++ b/misc/bstr.h @@ -56,9 +56,11 @@ static inline struct bstr bstrdup(void *talloc_ctx, struct bstr str) return r; } +#define bstr0_s(s) (struct bstr){(unsigned char *)(s), (s) ? strlen(s) : 0} + static inline struct bstr bstr0(const char *s) { - return (struct bstr){(unsigned char *)s, s ? strlen(s) : 0}; + return bstr0_s(s); } int bstrcmp(struct bstr str1, struct bstr str2); |