Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion samples/webrtc/C# Sample/WebRTC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ limitations under the License.
#include "stdafx.h"

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

🦩 🔴 WinSock headers included unconditionally in WebRTC.cpp

Wrapped the #include <WinSock2.h> and #include <WS2tcpip.h> lines near the top of the file (previously unconditional at file scope) in #ifdef WIN32 / #endif, matching the suggested fix exactly. This prevents these Windows-only headers from being pulled in on POSIX builds of this translation unit, while leaving all other content (including the separate #if defined(WIN32) block for _CRTDBG_MAP_ALLOC) untouched.

🤖 Prompt for AI agents
In samples/webrtc/C# Sample/WebRTC.cpp around line 21, review and complete this code-review fix: WinSock headers included unconditionally in WebRTC.cpp.
What the draft fix changed: Wrapped the `#include <WinSock2.h>` and `#include <WS2tcpip.h>` lines near the top of the file (previously unconditional at file scope) in `#ifdef WIN32` / `#endif`, matching the suggested fix exactly. This prevents these Windows-only headers from being pulled in on POSIX builds of this translation unit, while leaving all other content (including the separate `#if defined(WIN32)` block for `_CRTDBG_MAP_ALLOC`) untouched.
Verify the change is correct and complete; do not refactor unrelated code.

fix confidence: 🟢 90 high — react 👍/👎 to teach the reviewer

#include "WebRTC.h"

#ifdef WIN32
#include <WinSock2.h>
#include <WS2tcpip.h>
#endif

#if defined(WIN32)
#define _CRTDBG_MAP_ALLOC
Expand Down Expand Up @@ -469,4 +471,4 @@ extern "C"
return(ILibSCTP_Debug_SetDebugCallback(((void**)connection)[0], debugField, handler));
}
#endif
}
}