From e3d9b69e8c6f6b78120006282c020c71803a8075 Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Thu, 24 Aug 2023 11:55:54 -0400 Subject: [PATCH] Remove another decltype(fclose) See https://boringssl-review.googlesource.com/c/boringssl/+/62465. I missed a spot. Bug: 643 Change-Id: I2824853e37cac9112a9947fb794517e259f2bcc1 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/62645 Reviewed-by: Bob Beck Auto-Submit: David Benjamin Commit-Queue: David Benjamin --- crypto/bio/bio_test.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crypto/bio/bio_test.cc b/crypto/bio/bio_test.cc index a169b56d1..c9e0ae025 100644 --- a/crypto/bio/bio_test.cc +++ b/crypto/bio/bio_test.cc @@ -633,8 +633,11 @@ TEST(BIOTest, Gets) { check_bio_gets(bio.get()); } - using ScopedFILE = std::unique_ptr; - ScopedFILE file(tmpfile(), fclose); + struct FileCloser { + void operator()(FILE *f) const { fclose(f); } + }; + using ScopedFILE = std::unique_ptr; + ScopedFILE file(tmpfile()); #if defined(OPENSSL_ANDROID) // On Android, when running from an APK, |tmpfile| does not work. See // b/36991167#comment8.