Commit 402331fd authored by Dominik Charousset's avatar Dominik Charousset

Fix include order on MSVC

parent f4c5842b
...@@ -175,9 +175,11 @@ std::vector<iface_info> get_mac_addresses() { ...@@ -175,9 +175,11 @@ std::vector<iface_info> get_mac_addresses() {
// windows // windows
# include <iphlpapi.h> // clang-format off
# include <winsock2.h>
# include <ws2tcpip.h> # include <ws2tcpip.h>
# include <winsock2.h>
# include <iphlpapi.h>
// clang-format on
# include <algorithm> # include <algorithm>
# include <cctype> # include <cctype>
......
...@@ -25,14 +25,15 @@ ...@@ -25,14 +25,15 @@
#include <cstdlib> #include <cstdlib>
#include <cstring> #include <cstring>
// clang-format off
#ifdef CAF_WINDOWS #ifdef CAF_WINDOWS
# ifndef _WIN32_WINNT # ifndef _WIN32_WINNT
# define _WIN32_WINNT 0x0600 # define _WIN32_WINNT 0x0600
# endif # endif
# include <iostream> # include <iostream>
# include <iphlpapi.h>
# include <winsock2.h> # include <winsock2.h>
# include <ws2tcpip.h> # include <ws2tcpip.h>
# include <iphlpapi.h>
#else #else
# include <arpa/inet.h> # include <arpa/inet.h>
# include <ifaddrs.h> # include <ifaddrs.h>
...@@ -43,6 +44,7 @@ ...@@ -43,6 +44,7 @@
# include <sys/socket.h> # include <sys/socket.h>
# include <unistd.h> # include <unistd.h>
#endif #endif
// clang-format on
#include <memory> #include <memory>
#include <utility> #include <utility>
......
...@@ -23,11 +23,12 @@ ...@@ -23,11 +23,12 @@
#include "caf/logger.hpp" #include "caf/logger.hpp"
#include "caf/sec.hpp" #include "caf/sec.hpp"
// clang-format off
#ifdef CAF_WINDOWS #ifdef CAF_WINDOWS
# include <windows.h>
# include <winsock2.h> # include <winsock2.h>
# include <ws2ipdef.h> # include <windows.h>
# include <ws2tcpip.h> # include <ws2tcpip.h>
# include <ws2ipdef.h>
#else #else
# include <arpa/inet.h> # include <arpa/inet.h>
# include <cerrno> # include <cerrno>
...@@ -36,6 +37,7 @@ ...@@ -36,6 +37,7 @@
# include <sys/socket.h> # include <sys/socket.h>
# include <unistd.h> # include <unistd.h>
#endif #endif
// clang-format on
#ifdef CAF_WINDOWS #ifdef CAF_WINDOWS
using sa_family_t = short; using sa_family_t = short;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment