From 94b20e3128eaac566abfd7c0c773bb4c076c453e Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Thu, 03 Apr 2025 10:46:27 +0800 Subject: [PATCH] git2d: Use extern inline for utf8_decode --- Makefile | 4 ++-- git2d/utf8.c | 3 +++ git2d/utf8.h | 2 +- diff --git a/Makefile b/Makefile index dd43574980b75a528660def3468ee7d20a44927c..6dd0781c9a21cd0ea82ef29e6b75130446c9585e 100644 --- a/Makefile +++ b/Makefile @@ -21,8 +21,8 @@ utils/colb: hookc/hookc: -git2d/git2d: git2d/main.o git2d/bare.o - $(CC) $(CFLAGS) `pkg-config --cflags --libs libgit2` -lpthread -o git2d/git2d $< +git2d/git2d: git2d/main.o git2d/bare.o git2d/utf8.c + $(CC) $(CFLAGS) `pkg-config --cflags --libs libgit2` -lpthread -o git2d/git2d $^ version.go: printf 'package main\n\nconst VERSION = "%s"\n' `git describe --tags --always --dirty` > $@ diff --git a/git2d/utf8.c b/git2d/utf8.c new file mode 100644 index 0000000000000000000000000000000000000000..2937cb640577851985b86cb3cc90a5e21ef139a4 --- /dev/null +++ b/git2d/utf8.c @@ -0,0 +1,3 @@ +#include "utf8.h" + +extern inline void *utf8_decode(void *buf, uint32_t *c, int *e); diff --git a/git2d/utf8.h b/git2d/utf8.h index 894cbd508dd5acc90a3129592f607b87e420295e..56c6285040a9857fcc749228de386673009f1ee1 100644 --- a/git2d/utf8.h +++ b/git2d/utf8.h @@ -26,7 +26,7 @@ * The function returns a pointer to the next character. When an error * occurs, this pointer will be a guess that depends on the particular * error, but it will always advance at least one byte. */ -static void * +inline void * utf8_decode(void *buf, uint32_t *c, int *e) { static const char lengths[] = { -- 2.48.1