Skip to content

Conversation

@svenvh
Copy link
Member

@svenvh svenvh commented Sep 17, 2025

The _WIN32 macro is tested for defined-ness everywhere else. The instance here triggers a warning when compiling with -Wundef.

The `_WIN32` macro is tested for defined-ness everywhere else.  The
instance here triggers a warning when compiling with `-Wundef`.
@llvmbot
Copy link
Member

llvmbot commented Sep 17, 2025

@llvm/pr-subscribers-llvm-support

Author: Sven van Haastregt (svenvh)

Changes

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 --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)

Copy link
Member

@mstorsjo mstorsjo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@svenvh svenvh merged commit 07a7928 into llvm:main Sep 17, 2025
11 checks passed
@svenvh svenvh deleted the wundef-win32 branch September 17, 2025 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants