From 151ff08f430069025818c1cc9bae37355f09a4a6 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Tue, 13 Feb 2024 16:49:54 +0100 Subject: Bump librune --- vendor/librune/include/mbstring.h | 2 ++ vendor/librune/lib/mbstring/u8cmp.c | 11 +++++++++++ vendor/librune/make.c | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 vendor/librune/lib/mbstring/u8cmp.c diff --git a/vendor/librune/include/mbstring.h b/vendor/librune/include/mbstring.h index c1336a8..29c7421 100644 --- a/vendor/librune/include/mbstring.h +++ b/vendor/librune/include/mbstring.h @@ -32,6 +32,8 @@ size_t u8bspn(const char8_t *, size_t, const rune *, size_t); size_t u8cspn(const char8_t *, size_t, const rune *, size_t); size_t u8cbspn(const char8_t *, size_t, const rune *, size_t); +int u8cmp(struct u8view, struct u8view); + #if !_RUNE_NO_MACRO_WRAPPER # define u8chk(s, n) _RUNE_Q_PTR(u8chk, (s), (s), (n)) # define u8chr(s, ch, n) _RUNE_Q_PTR(u8chr, (s), (s), (ch), (n)) diff --git a/vendor/librune/lib/mbstring/u8cmp.c b/vendor/librune/lib/mbstring/u8cmp.c new file mode 100644 index 0000000..732896c --- /dev/null +++ b/vendor/librune/lib/mbstring/u8cmp.c @@ -0,0 +1,11 @@ +#include + +#include "mbstring.h" + +int +u8cmp(struct u8view x, struct u8view y) +{ + if (x.len != y.len) + return x.len > y.len ? +1 : -1; + return memcmp(x.p, y.p, x.len); +} diff --git a/vendor/librune/make.c b/vendor/librune/make.c index 6f59825..8c3f265 100644 --- a/vendor/librune/make.c +++ b/vendor/librune/make.c @@ -31,7 +31,7 @@ cmdclr(&(C)); \ } while (0) #define CMDPRC(C) _CMDPRC(C, cmdput) -#define CMDPRC2(C) _CMDPRC(C, cmdput) +#define CMDPRC2(C) _CMDPRC(C, cmdput2) #define streq(a, b) (!strcmp(a, b)) -- cgit v1.2.3