Skip to content

Instantly share code, notes, and snippets.

@sunnyyoung
Created April 23, 2024 03:31
Show Gist options
  • Save sunnyyoung/3e9f3313a15bf404e207c2d0fb9cffae to your computer and use it in GitHub Desktop.
Save sunnyyoung/3e9f3313a15bf404e207c2d0fb9cffae to your computer and use it in GitHub Desktop.
$VERSION="20220613"
$SRC="$PWD\boringssl"
$DST="$PWD\boringssl.builds"
$PLATFORMS="win32", "x64"
Write-Output "Checking out boringssl..."
git clone https://boringssl.googlesource.com/boringssl --depth 1 --branch fips-$VERSION
Write-Output "Patching boringssl..."
Set-Content -Path boringssl.patch -Value @"
diff --git a/crypto/bio/connect.c b/crypto/bio/connect.c
index 3b65acf..63cf676 100644
--- a/crypto/bio/connect.c
+++ b/crypto/bio/connect.c
@@ -485,7 +485,10 @@ static long conn_callback_ctrl(BIO *bio, int cmd, bio_info_cb fp) {
switch (cmd) {
case BIO_CTRL_SET_CALLBACK:
+#pragma warning(push)
+#pragma warning(disable: 4191)
data->info_callback = (int (*)(const struct bio_st *, int, int))fp;
+#pragma warning(pop)
break;
default:
ret = 0;
diff --git a/third_party/googletest/include/gtest/internal/gtest-param-util.h b/third_party/googletest/include/gtest/internal/gtest-param-util.h
index d12bd55..3ee9e56 100644
--- a/third_party/googletest/include/gtest/internal/gtest-param-util.h
+++ b/third_party/googletest/include/gtest/internal/gtest-param-util.h
@@ -92,7 +92,10 @@ template <typename> class ParamGenerator;
template <typename T>
class ParamIteratorInterface {
public:
+#pragma warning(push)
+#pragma warning(disable: 5267)
virtual ~ParamIteratorInterface() {}
+#pragma warning(pop)
// A pointer to the base generator instance.
// Used only for the purposes of iterator comparison
// to make sure that two iterators belong to the same generator.
@@ -843,7 +846,10 @@ class CartesianProductGenerator
current_(is_end ? end_ : begin_) {
ComputeCurrentValue();
}
+#pragma warning(push)
+#pragma warning(disable: 4616 5267)
~IteratorImpl() override {}
+#pragma warning(pop)
const ParamGeneratorInterface<ParamType>* BaseGenerator() const override {
return base_;
"@
git -C "$SRC" apply ../boringssl.patch
Write-Output "Building boringssl..."
foreach ($PLATFORM in $PLATFORMS) {
cmake -B "$DST\$PLATFORM" -S "$SRC" -A $PLATFORM
cmake --build "$DST\$PLATFORM" --config Release
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment