Change #273031
| Category | curl |
| Changed by | Viktor Szakats <commit@vsz.me> |
| Changed at | Sat 27 Jun 2026 01:24:39 |
| Repository | https://github.com/curl/curl.git |
| Project | curl |
| Branch | master |
| Revision | 39dec13ec08f8511f22ddc78bb36b40241dee915 |
Comments
build: always use local `inet_pton()`/`inet_ntop()` implementations Also repurpose existing build-time feature checks into unit test 1961, to verify. Prior to this patch these functions were auto-detected with both autotools and cmake. In case of autotools there was an extra verification phase ensuring the functions work as expected. This step required running the function, thus was limited to non-cross-builds. For cross-builds and CMake it always used the system implementation if present. On Windows it always used the local implementation, because availability/use is complicated there. After this patch all platforms, always use the local implementation, which is known to be accurate. This makes curl behave more consistently, and simplifies the build process, a fixes cross-builds and CMake auto-detection differences. Also: - test1960: enable unconditionally. - checksrc: disallow globally, allowlist in `block_ip.c` example. - dnsd: verify ntop result for NULL before passing to printf. Ref: https://github.com/curl/curl/pull/22137#issuecomment-4797440983 Ref: #22137 Ref: 8537a5b0bcf4565551774c2b2375c49767e405a7 #16577 Closes #22170
Changed files
- CMake/unix-cache.cmake
- CMake/win32-cache.cmake
- CMakeLists.txt
- configure.ac
- docs/examples/block_ip.c
- docs/internals/CODE_STYLE.md
- lib/config-win32.h
- lib/curl_config-cmake.h.in
- lib/curlx/inet_ntop.c
- lib/curlx/inet_ntop.h
- lib/curlx/inet_pton.c
- lib/curlx/inet_pton.h
- m4/curl-functions.m4
- scripts/checksrc.pl
- tests/data/Makefile.am
- tests/data/test1961
- tests/libtest/Makefile.inc
- tests/libtest/first.h
- tests/libtest/lib1960.c
- tests/server/dnsd.c
- tests/unit/Makefile.inc
- tests/unit/unit1961.c