From 23d49642cfcafe76befbcb1512730837ff50ce40 Mon Sep 17 00:00:00 2001 From: anon Date: Wed, 25 Dec 2024 21:18:10 +0100 Subject: [PATCH] fix: compile in 2024 --- account.cpp | 2 ++ install.mk | 8 ++++---- makefile | 4 ++-- omemo.cpp | 8 ++++---- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/account.cpp b/account.cpp index ced9a57..fc25f95 100644 --- a/account.cpp +++ b/account.cpp @@ -10,6 +10,8 @@ #include #include #include +#include +#include #include #include "plugin.hh" diff --git a/install.mk b/install.mk index 90bdd35..fe55eff 100755 --- a/install.mk +++ b/install.mk @@ -1,7 +1,7 @@ #!/usr/bin/env -S gmake install # vim: set noexpandtab: -HOME ?=~ +WEECHATHOME ?= ~/.local/share/weechat/ install: xmpp.so ifeq ($(shell id -u),0) @@ -9,9 +9,9 @@ ifeq ($(shell id -u),0) cp xmpp.so $(DESTDIR)$(LIBDIR)/weechat/plugins/xmpp.so chmod 644 $(DESTDIR)$(LIBDIR)/weechat/plugins/xmpp.so else - mkdir -p $(HOME)/.weechat/plugins - cp xmpp.so $(HOME)/.weechat/plugins/xmpp.so - chmod 755 $(HOME)/.weechat/plugins/xmpp.so + mkdir -p $(WEECHATHOME)/plugins + cp xmpp.so $(WEECHATHOME)/plugins/xmpp.so + chmod 755 $(WEECHATHOME)/plugins/xmpp.so endif release: xmpp.so diff --git a/makefile b/makefile index a5f11cd..62ed178 100644 --- a/makefile +++ b/makefile @@ -12,7 +12,7 @@ SHELL ?= bash RM ?= rm -f FIND ?= find -INCLUDES=-Ilibstrophe -Ideps \ +INCLUDES=-Ilibstrophe -Ideps -I/usr/include/omemo/ \ $(shell xml2-config --cflags) \ $(shell pkg-config --cflags gpgme) \ $(shell pkg-config --cflags libsignal-protocol-c) @@ -44,9 +44,9 @@ ifeq ($(CXX),clang) else CPPFLAGS+= endif + #-fuse-ld=mold LDFLAGS+=$(DBGLDFLAGS) \ -std=c++23 -gdwarf-4 \ - -fuse-ld=mold \ $(DBGCFLAGS) LDLIBS=-lstrophe \ -lpthread \ diff --git a/omemo.cpp b/omemo.cpp index 45ff542..644e657 100644 --- a/omemo.cpp +++ b/omemo.cpp @@ -53,25 +53,25 @@ const char *OMEMO_ADVICE = "[OMEMO encrypted message (XEP-0384)]"; size_t base64_decode(const char *buffer, size_t length, uint8_t **result) { *result = (uint8_t*)calloc(length + 1, sizeof(uint8_t)); - return weechat_string_base_decode(64, buffer, (char*)*result); + return weechat_string_base_decode("64", buffer, (char*)*result); } size_t base64_encode(const uint8_t *buffer, size_t length, char **result) { *result = (char*)calloc(length * 2, sizeof(char)); - return weechat_string_base_encode(64, (char*)buffer, length, *result); + return weechat_string_base_encode("64", (char*)buffer, length, *result); } std::vector base64_decode(std::string_view buffer) { auto result = std::make_unique(buffer.size() + 1); - return std::vector(result.get(), result.get() + weechat_string_base_decode(64, buffer.data(), (char*)result.get())); + return std::vector(result.get(), result.get() + weechat_string_base_decode("64", buffer.data(), (char*)result.get())); } std::string base64_encode(std::vector buffer) { auto result = std::make_unique(buffer.size() * 2); - return std::string(result.get(), result.get() + weechat_string_base_encode(64, (char*)buffer.data(), buffer.size(), result.get())); + return std::string(result.get(), result.get() + weechat_string_base_encode("64", (char*)buffer.data(), buffer.size(), result.get())); } int aes_decrypt(const uint8_t *ciphertext, size_t ciphertext_len,