From 004073a7b79dc9c455416703d30f4922b4577172 Mon Sep 17 00:00:00 2001 From: Gabriele Contini <contini.mailing@gmail.com> Date: 周六, 16 5月 2020 23:18:22 +0800 Subject: [PATCH] tentative fix for test failing when in submodule --- src/library/os/network.hpp | 16 +++++++++------- 1 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/library/os/network.hpp b/src/library/os/network.hpp index 5ddf266..33e78b0 100644 --- a/src/library/os/network.hpp +++ b/src/library/os/network.hpp @@ -10,6 +10,15 @@ #include <stdlib.h> #include <vector> +#ifdef __unix__ +#include <netdb.h> +#define LCC_ADAPTER_DESCRIPTION_LEN NI_MAXHOST +#else +#include <Windows.h> +#include <iphlpapi.h> +#define LCC_ADAPTER_DESCRIPTION_LEN MAX_ADAPTER_DESCRIPTION_LENGTH +#endif + #include "../base/base.h" namespace license { @@ -17,13 +26,6 @@ typedef enum { IFACE_TYPE_ETHERNET, IFACE_TYPE_WIRELESS } IFACE_TYPE; -#ifdef __unix__ -#include <netdb.h> -#define LCC_ADAPTER_DESCRIPTION_LEN NI_MAXHOST -#else -#include <iphlpapi.h> -#define LCC_ADAPTER_DESCRIPTION_LEN MAX_ADAPTER_DESCRIPTION_LENGTH -#endif typedef struct { int id; -- Gitblit v1.9.1