Browse Source

fix build error if ENABLE_UDS on windows (#417)

Co-authored-by: yuze <yuze@nextas.com>
alan0526 2 years ago
parent
commit
95e93e3299
1 changed files with 4 additions and 0 deletions
  1. 4 0
      base/hsocket.h

+ 4 - 0
base/hsocket.h

@@ -5,8 +5,12 @@
 #include "hplatform.h"
 
 #ifdef ENABLE_UDS
+#ifdef OS_WIN
+    #include <afunix.h> // import struct sockaddr_un
+#else
     #include <sys/un.h> // import struct sockaddr_un
 #endif
+#endif
 
 #ifdef _MSC_VER
 #pragma comment(lib, "ws2_32.lib")