Skip to content

Commit 98dbc4a

Browse files
committed
AppVeyor: Fix build with Visual Studio 2019, ARM64
Define PopulationCount64=1 when needed. The errors were: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\um\winnt.h (6343,27): warning C4013: '_CountOneBits64' undefined; assuming extern returning int [skip ci]
1 parent 1a204c0 commit 98dbc4a

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.appveyor.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,14 @@ environment:
9595
PLATFORM: ARM64
9696
SDK: npcap-sdk
9797
REMOTE: -DENABLE_REMOTE=NO
98+
POPULATIONCOUNT64: -DPOPULATIONCOUNT64=1
9899
# VS 2019, Npcap, 64-bit ARM, with remote
99100
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
100101
GENERATOR: "Visual Studio 16 2019"
101102
PLATFORM: ARM64
102103
SDK: npcap-sdk
103104
OPENSSL_ROOT_DIR: -DOPENSSL_ROOT_DIR=C:\OpenSSL-v33-Win64\bin
105+
POPULATIONCOUNT64: -DPOPULATIONCOUNT64=1
104106
# VS 2022, WinPcap, 32-bit and 64-bit x86, without remote
105107
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
106108
GENERATOR: "Visual Studio 17 2022"
@@ -167,5 +169,5 @@ build_script:
167169
- md build
168170
- cd build
169171
- cmake --version
170-
- cmake %REMOTE% %OPENSSL_ROOT_DIR% -DPacket_ROOT=c:\projects\libpcap\Win32\%SDK% -G"%GENERATOR%" -DPacket_ROOT=c:\projects\libpcap\Win32\%SDK% -DPacket_ROOT=c:\projects\libpcap\Win32\%SDK% -G"%GENERATOR%" -G"%GENERATOR%" -A %PLATFORM% ..
172+
- cmake %POPULATIONCOUNT64% %REMOTE% %OPENSSL_ROOT_DIR% -DPacket_ROOT=c:\projects\libpcap\Win32\%SDK% -G"%GENERATOR%" -DPacket_ROOT=c:\projects\libpcap\Win32\%SDK% -DPacket_ROOT=c:\projects\libpcap\Win32\%SDK% -G"%GENERATOR%" -G"%GENERATOR%" -A %PLATFORM% ..
171173
- msbuild /m /nologo /p:Configuration=Release pcap.sln

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,9 @@ endif(WIN32)
656656
if(MSVC)
657657
add_definitions(-D__STDC__)
658658
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
659+
if(DEFINED POPULATIONCOUNT64)
660+
add_compile_definitions(PopulationCount64=${POPULATIONCOUNT64})
661+
endif()
659662
endif(MSVC)
660663

661664
if(USE_STATIC_RT)

0 commit comments

Comments
 (0)