[llvm] Fix _WIN32 Wundef warning; NFC (PR #159301)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 17 02:52:56 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-support
Author: Sven van Haastregt (svenvh)
<details>
<summary>Changes</summary>
The `_WIN32` macro is tested for defined-ness everywhere else. The instance here triggers a warning when compiling with `-Wundef`.
---
Full diff: https://github.com/llvm/llvm-project/pull/159301.diff
1 Files Affected:
- (modified) llvm/lib/Support/raw_socket_stream.cpp (+1-1)
``````````diff
diff --git a/llvm/lib/Support/raw_socket_stream.cpp b/llvm/lib/Support/raw_socket_stream.cpp
index fd1c681672138..3b510d357fd5d 100644
--- a/llvm/lib/Support/raw_socket_stream.cpp
+++ b/llvm/lib/Support/raw_socket_stream.cpp
@@ -255,7 +255,7 @@ manageTimeout(const std::chrono::milliseconds &Timeout,
// has been canceled by another thread
if (getActiveFD() == -1 || (CancelFD.has_value() && FD[1].revents & POLLIN))
return std::make_error_code(std::errc::operation_canceled);
-#if _WIN32
+#ifdef _WIN32
if (PollStatus == SOCKET_ERROR)
#else
if (PollStatus == -1)
``````````
</details>
https://github.com/llvm/llvm-project/pull/159301
More information about the llvm-commits
mailing list