Compare commits
No commits in common. "f40d2912cd40698c2ea6638185fe345007a18f7a" and "60131b5cc7e4d273dced3625e7aa780bf916702a" have entirely different histories.
f40d2912cd
...
60131b5cc7
1 changed files with 1 additions and 4 deletions
|
|
@ -21,9 +21,6 @@ module;
|
|||
#if defined(CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_pc_windows_msvc) || defined(CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_w64_mingw32)
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
// <rpc.h> (pulled in transitively) defines `interface` as a macro for `struct`,
|
||||
// which collides with local variables named `interface` in this TU.
|
||||
#undef interface
|
||||
#else
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
|
|
@ -1474,7 +1471,7 @@ int Crafter::Run(int argc, char** argv) {
|
|||
sockaddr_in addr{};
|
||||
addr.sin_family = AF_INET;
|
||||
addr.sin_addr.s_addr = htonl(INADDR_ANY);
|
||||
addr.sin_port = htons(static_cast<std::uint16_t>(p));
|
||||
addr.sin_port = htons(static_cast<uint16_t>(p));
|
||||
bool ok = ::bind(s, reinterpret_cast<sockaddr*>(&addr), sizeof(addr)) == 0;
|
||||
closesock(s);
|
||||
if (ok) return p;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue