]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
MinGW: Fix error: cannot convert 'const int*' to 'const char*' (#1824)
authorAmos Jeffries <yadij@users.noreply.github.com>
Wed, 29 May 2024 06:05:08 +0000 (06:05 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Thu, 30 May 2024 13:40:39 +0000 (13:40 +0000)
src/comm/Tcp.cc

index 43c5da0d9ef4e20eeed594cf41e1f2479f4322fd..c847cfbc603c9a2de8a146783fcca252f46461b4 100644 (file)
@@ -30,7 +30,7 @@ SetSocketOption(const int fd, const int level, const int optName, const Option &
 {
     static_assert(std::is_trivially_copyable<Option>::value, "setsockopt() expects POD-like options");
     static_assert(!std::is_same<Option, bool>::value, "setsockopt() uses int to represent boolean options");
-    if (setsockopt(fd, level, optName, &optValue, sizeof(optValue)) < 0) {
+    if (setsockopt(fd, level, optName, reinterpret_cast<const char *>(&optValue), sizeof(optValue)) < 0) {
         const auto xerrno = errno;
         debugs(5, DBG_IMPORTANT, "ERROR: setsockopt(2) failure: " << xstrerr(xerrno));
         // TODO: Generalize to throw on errors when some callers need that.