Fix MinGW build issue on example (#2642)

* Fix MinGW build issue on example #2638

* Move the cmake change to example\CMakeLists.txt

* Update CMakeLists.txt on the example
This commit is contained in:
Zeus James
2023-02-12 16:34:22 +08:00
committed by GitHub
parent 927cc29444
commit da14258533
3 changed files with 7 additions and 6 deletions

View File

@@ -15,9 +15,11 @@
#include <stdio.h>
#include <string>
#pragma comment(lib, "Ws2_32.lib")
#pragma comment(lib, "Mswsock.lib")
#pragma comment(lib, "AdvApi32.lib")
#if defined(_MSC_VER)
# pragma comment(lib, "Ws2_32.lib")
# pragma comment(lib, "Mswsock.lib")
# pragma comment(lib, "AdvApi32.lib")
#endif
namespace spdlog {
namespace details {
@@ -25,7 +27,7 @@ class udp_client
{
static constexpr int TX_BUFFER_SIZE = 1024 * 10;
SOCKET socket_ = INVALID_SOCKET;
sockaddr_in addr_ = {0};
sockaddr_in addr_ = {};
static void init_winsock_()
{