fix: compile in 2024

pull/13/head
anon 1 week ago
parent f7c7c9985d
commit 23d49642cf

@ -10,6 +10,8 @@
#include <assert.h>
#include <fmt/core.h>
#include <libxml/xmlwriter.h>
#include <libxml/xmlerror.h>
#include <libxml/parser.h>
#include <weechat/weechat-plugin.h>
#include "plugin.hh"

@ -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

@ -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 \

@ -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<std::uint8_t> base64_decode(std::string_view buffer)
{
auto result = std::make_unique<std::uint8_t[]>(buffer.size() + 1);
return std::vector<std::uint8_t>(result.get(), result.get() + weechat_string_base_decode(64, buffer.data(), (char*)result.get()));
return std::vector<std::uint8_t>(result.get(), result.get() + weechat_string_base_decode("64", buffer.data(), (char*)result.get()));
}
std::string base64_encode(std::vector<std::uint8_t> buffer)
{
auto result = std::make_unique<char[]>(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,

Loading…
Cancel
Save