[llvm] Add raw_socket_stream (PR #73603)

Michael Spencer via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 30 03:12:32 PST 2023


================
@@ -23,11 +24,21 @@
 #include "llvm/Support/NativeFormatting.h"
 #include "llvm/Support/Process.h"
 #include "llvm/Support/Program.h"
+#include "llvm/Support/Threading.h"
 #include <algorithm>
 #include <cerrno>
 #include <cstdio>
 #include <sys/stat.h>
 
+#include <iostream>
+#ifdef _WIN32
+#include <afunix.h>
+#include <winsock2.h>
----------------
Bigcheese wrote:

This fails to build for two reasons:
* afunix.h has to be included after winsock2.h.
* winsock2.h includes windows.h which defines the `min` and `max` macros unless you first define `NOMINMAX`. WindowsSupport.h handles all this, so all Windows headers should be included after that.

I'd just remove these includes and move them down under the WindowsSupport.h include.

https://github.com/llvm/llvm-project/pull/73603


More information about the llvm-commits mailing list