From 0ab5199272729343aa060a545aecd75a05862d68 Mon Sep 17 00:00:00 2001 From: Koichiro IWAO Date: Sat, 17 Jun 2023 01:57:11 +0900 Subject: [PATCH] Fix build when NO_VLAN Occurred at: #670 Closes: #1864 Tested build on FreeBSD with NO_VLAN by modifying CMakeLists.txt like this: ```diff diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c49a3c78..1dad3691 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -93,6 +93,7 @@ if(UNIX) if(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD") add_definitions(-DUNIX_BSD -DBRIDGE_BPF) + add_definitions(-DNO_VLAN) include_directories(SYSTEM /usr/local/include) link_directories(SYSTEM /usr/local/lib) endif() ``` --- src/Cedar/BridgeUnix.c | 2 +- src/Cedar/Client.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Cedar/BridgeUnix.c b/src/Cedar/BridgeUnix.c index d5890cba..06ce795c 100644 --- a/src/Cedar/BridgeUnix.c +++ b/src/Cedar/BridgeUnix.c @@ -1416,7 +1416,7 @@ ETH *OpenEthBSD(char *name, bool local, bool tapmode, char *tapaddr) return e; #else // NO_VLAN -return NULL: + return NULL; #endif // NO_VLAN } diff --git a/src/Cedar/Client.c b/src/Cedar/Client.c index a4175a3c..406a9db1 100644 --- a/src/Cedar/Client.c +++ b/src/Cedar/Client.c @@ -22,6 +22,9 @@ #include "VLanWin32.h" #include "Win32Com.h" #include "WinUi.h" +#ifdef NO_VLAN +#include "NullLan.h" +#endif #include "Mayaqua/Cfg.h" #include "Mayaqua/Encrypt.h"