From 0f8d0cb6db3e8bb0af71c66f510b6491d148f3df Mon Sep 17 00:00:00 2001
From: Gabriele Contini <contini.mailing@gmail.com>
Date: 周六, 16 5月 2020 22:50:13 +0800
Subject: [PATCH] windows...

---
 src/library/os/network.hpp |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/src/library/os/network.hpp b/src/library/os/network.hpp
index 6ba1611..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,9 +26,10 @@
 
 typedef enum { IFACE_TYPE_ETHERNET, IFACE_TYPE_WIRELESS } IFACE_TYPE;
 
+
 typedef struct {
 	int id;
-	char description[1024];
+	char description[LCC_ADAPTER_DESCRIPTION_LEN + 1];
 	unsigned char mac_address[8];
 	unsigned char ipv4_address[4];
 	IFACE_TYPE type;

--
Gitblit v1.9.1