Skip to content

Commit 618d20e

Browse files
RahulHereRahulHere
authored andcommitted
Improve Windows MinGW build for inet_ntop/inet_pton
Add _WIN32_WINNT=0x0600 compile definition for Windows builds to ensure inet_ntop and inet_pton are declared. These functions require Windows Vista or later.
1 parent df7fc23 commit 618d20e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,11 +691,13 @@ else()
691691
endforeach()
692692
endif()
693693

694-
# Add Windows-specific socket libraries
694+
# Add Windows-specific socket libraries and definitions
695695
if(WIN32)
696696
foreach(lib_target ${REAL_TARGETS})
697697
if(TARGET ${lib_target})
698698
target_link_libraries(${lib_target} PRIVATE ws2_32 crypt32 iphlpapi)
699+
# Require Windows Vista or later for inet_ntop/inet_pton
700+
target_compile_definitions(${lib_target} PRIVATE _WIN32_WINNT=0x0600)
699701
endif()
700702
endforeach()
701703
endif()

0 commit comments

Comments
 (0)