Fix the build with MSVC: nssocket() a function everywhere

Outside Linux nssocket() was a macro, and two of its callers have #ifdef
WITH_UN among its arguments. Preprocessor directives in macro arguments
are undefined behaviour: gcc and clang take them, MSVC does not. It is a
function on every system now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Vladimir DubrovinandClaude Opus 5.5 committed 2026-10-12 22:04:01 +03:00
1 parent 43ae0389bf
commit 3d5da0105d
2 files changed
+8 -3

No files matched your search

+5
View File
@@ -77,6 +77,11 @@ SOCKET nssocket(struct srvparam *srv, struct sockfuncs *sf, void *state, int sid
errno = err;
return s;
}
#else
/* no network namespaces: a socket is made where it always is */
SOCKET nssocket(struct srvparam *srv, struct sockfuncs *sf, void *state, int side, int domain, int type, int protocol){
return sf->_socket(state, domain, type, protocol);
}
#endif