MSVC sucks lol

legacy
Charlotte Som 2021-09-12 02:04:30 +01:00
parent 5a6385f0b0
commit 7cbbf919d5
4 changed files with 55 additions and 13 deletions

18
Cargo.lock generated
View File

@ -1366,8 +1366,6 @@ dependencies = [
[[package]]
name = "olm-sys"
version = "1.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "067ed86d3c0ab5d9009601082cd16a438e2104174f956d38fc81e0ad56f5696b"
dependencies = [
"cmake",
]
@ -2173,18 +2171,18 @@ checksum = "f638d531eccd6e23b980caf34876660d38e265409d8e99b397ab71eb3612fad0"
[[package]]
name = "serde"
version = "1.0.127"
version = "1.0.130"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f03b9878abf6d14e6779d3f24f07b2cfa90352cfec4acc5aab8f1ac7f146fae8"
checksum = "f12d06de37cf59146fbdecab66aa99f9fe4f78722e3607577a5375d66bd0c913"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.127"
version = "1.0.130"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a024926d3432516606328597e0f224a51355a493b49fdd67e9209187cbe55ecc"
checksum = "d7bc1a1ab1961464eae040d96713baa5a724a8152c1222492465b54322ec508b"
dependencies = [
"proc-macro2 1.0.28",
"quote 1.0.9",
@ -2216,9 +2214,9 @@ dependencies = [
[[package]]
name = "serenity"
version = "0.10.8"
version = "0.10.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b68c1f5dbe25b32516f3f104726a9e8e3a96cf5960a106213241738ffe108f81"
checksum = "6275d443266aedf2be507a245ddc23db0c07b1b99774e16f3c879e96a78b067a"
dependencies = [
"async-trait",
"async-tungstenite",
@ -2555,9 +2553,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c"
[[package]]
name = "tokio"
version = "1.9.0"
version = "1.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4b7b349f11a7047e6d1276853e612d152f5e8a352c61917887cc2169e2366b4c"
checksum = "b4efe6fc2395938c8155973d7be49fe8d03a843726e285e100a8a383cc0154ce"
dependencies = [
"autocfg",
"bytes 1.0.1",

View File

@ -7,9 +7,13 @@ edition = "2018"
bincode = "1.3.3"
discord_message_format = { git = "https://git.lavender.software/charlotte/discord-message-format.git" }
matrix-sdk = { git = "https://github.com/matrix-org/matrix-rust-sdk.git" }
serde = { version = "1.0.127", features = ["derive"] }
serenity = "0.10.8"
serde = { version = "1.0.129", features = ["derive"] }
serenity = "0.10.9"
sled = "0.34.6"
tokio = { version = "1.8.0", features = ["full"] }
tokio = { version = "1.10.1", features = ["full"] }
tracing = "0.1.26"
url = "2.2.2"
[patch.crates-io]
olm-sys = { path = "./target/patch/olm-sys-1.1.2" }
# You gotta apply the patch or simply clone olm-sys to that location :>

View File

@ -1,3 +1,5 @@
# phoebe
bridgers
olm-sys is patched using `olm-sys-win.patch` to let it build on windows :)

38
olm-sys-win.patch Normal file
View File

@ -0,0 +1,38 @@
--- olm/tests/test_base64.cpp 2021-09-12 01:51:01.587794700 +0100
+++ olm/tests/test_base64.cpp 2021-09-12 01:52:11.937270600 +0100
@@ -1,6 +1,8 @@
#include "olm/base64.hh"
#include "olm/base64.h"
#include "unittest.hh"
+#include <cstring>
+#include <vector>
int main() {
@@ -68,7 +70,6 @@
{
TestCase test_case("Decoding base64 of invalid length fails with -1");
-#include <iostream>
std::uint8_t input[] = "SGVsbG8gV29ybGQab";
std::size_t input_length = sizeof(input) - 1;
@@ -76,14 +77,12 @@
* Nothing will be written to the output buffer anyway because the input is
* invalid. */
std::size_t buf_length = olm::decode_base64_length(input_length + 1);
-std::uint8_t output[buf_length];
-std::uint8_t expected_output[buf_length];
-memset(output, 0, buf_length);
-memset(expected_output, 0, buf_length);
+std::vector<std::uint8_t> output(buf_length, 0);
+std::vector<std::uint8_t> expected_output(buf_length, 0);
-std::size_t output_length = ::_olm_decode_base64(input, input_length, output);
+std::size_t output_length = ::_olm_decode_base64(input, input_length, output.data());
assert_equals(std::size_t(-1), output_length);
-assert_equals(0, memcmp(output, expected_output, buf_length));
+assert_equals(0, memcmp(output.data(), expected_output.data(), buf_length));
}
}