History log of /curl/CMake/Platforms/WindowsCache.cmake (Results 1 – 25 of 55)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 01a81579 11-Oct-2024 Viktor Szakats

cmake: tidy-ups and rebase fixups

- limit `SIZEOF_SA_FAMILY_T` detection to non-Windows.
- make sure `sys/socket.h` exists before detecting `SIZEOF_SA_FAMILY_T`.
- limit `mach_absolu

cmake: tidy-ups and rebase fixups

- limit `SIZEOF_SA_FAMILY_T` detection to non-Windows.
- make sure `sys/socket.h` exists before detecting `SIZEOF_SA_FAMILY_T`.
- limit `mach_absolute_time()` detection to `APPLE`. Drop from Windows
pre-cache.
- skip `HAVE_LIBSOCKET` detection for Windows, drop pre-cached value.
- drop redundant pre-cached `HAVE_LIBZ` for Windows.
- `curl_required_libpaths()`: stop accepting multiple arguments.
To prepare for `CMAKE_REQUIRED_LINK_DIRECTORIES` support.
Follow-up to 7bab201abe3915a0167c002f9308950cb8a06e4b #15193
- GSS: fix recent rebase mistakes:
- fix variable name.
- do not add a header twice.
Follow-up to 91d451b48809f20415ba8627786f5d4f5aaf8bfe #15157
- GSS: quote a variable.

Closes #15271

show more ...


# e888069f 06-Oct-2024 Viktor Szakats

cmake: detect `HAVE_NETINET_IN6_H`, `HAVE_CLOSESOCKET_CAMEL`, `HAVE_PROTO_BSDSOCKET_H`

To sync with `./configure`.

- `HAVE_NETINET_IN6_H` is
needed by HPE NonStop NSE and NSX

cmake: detect `HAVE_NETINET_IN6_H`, `HAVE_CLOSESOCKET_CAMEL`, `HAVE_PROTO_BSDSOCKET_H`

To sync with `./configure`.

- `HAVE_NETINET_IN6_H` is
needed by HPE NonStop NSE and NSX systems.
Follow-up to 76ebd54175bad02b29769d797adf72fdf3df119f #2155

- `HAVE_CLOSESOCKET_CAMEL`, `HAVE_PROTO_BSDSOCKET_H`
are for AmigaOS.
(Note: `./configure` tries to detect these for all targets, cmake does
it only for AmigaOS, to not inflate configure time.)

Closes #15172

show more ...


# 5e705660 06-Oct-2024 Viktor Szakats

build: detect and use `_setmode()` with Cygwin/MSYS, also use on Windows

Before this patch `setmode()` was not detected with Cygwin/MSYS, because
it's a macro, not a function, and detect

build: detect and use `_setmode()` with Cygwin/MSYS, also use on Windows

Before this patch `setmode()` was not detected with Cygwin/MSYS, because
it's a macro, not a function, and detection is looking for a function.

Switching to symbol detection doesn't work because it mis-detects it on
BSD systems which features a function with the same name but different
functionality and arguments.

Fix it by looking for a `_setmode()` function on Cygwin/MSYS, and use it
if available.

`_setmode()` is recommended over `setmode()` by Windows documentation so
use that on Windows too. It seems to be available on all supported
compilers, so omit detection.

https://learn.microsoft.com/cpp/c-runtime-library/reference/posix-setmode
https://learn.microsoft.com/cpp/c-runtime-library/reference/setmode

Officially Windows requires argument `_O_BINARY` with an underscore.
`O_BINARY` is also supported but bound to conditions. Continue to use it
for simplicity. Cygwin supports `O_BINARY` (no underscore).

Closes #15169

show more ...


# c72cefea 30-Sep-2024 Daniel Stenberg

select: use poll() if existing, avoid poll() with no sockets

poll() on macOS 10.12 was deemed broken in 2016 when we discovered that
it misbehaves when provided with no sockets to wait f

select: use poll() if existing, avoid poll() with no sockets

poll() on macOS 10.12 was deemed broken in 2016 when we discovered that
it misbehaves when provided with no sockets to wait for. The
HAVE_POLL_FINE is used to mark a poll() implementation that behaves
correctly: it *should* still wait the timeout time.

curl has therefore opted to use select() on Apple operating systems ever
since. To avoid the risk that this or other breakage cause problems.

However, using select() internally is also bad because it suffers from
problems when using file descriptors beyond 1024.

This change makes poll() used if it is present, but if there is no
sockets to wait for it avoids using poll() and instead falls back to
select() - but without any sockets to wait for there is no 1024 problem.

This removes all previous special-handling involving HAVE_POLL_FINE.

ref: https://daniel.haxx.se/blog/2016/10/11/poll-on-mac-10-12-is-broken/

Closes #15096

show more ...


# 97c0f89b 12-Sep-2024 Stefan Eissing

quic: use send/recvmmsg when available

add checks for sendmmsg in configure and CmakeLists.txt for enabling use
of these functions in ngtcp2/quiche quic.

Closes #14880


# aaacd024 25-Aug-2024 Viktor Szakats

GHA/configure-vs-cmake: add Windows build, fix issues

- configure: disable pthreads by default on Windows.
- configure: disable detecting `fseeko()` on Windows.
(It exists in mingw

GHA/configure-vs-cmake: add Windows build, fix issues

- configure: disable pthreads by default on Windows.
- configure: disable detecting `fseeko()` on Windows.
(It exists in mingw-w64 2.0.0 and newer, but it's permanently ignored
in CMake, as this function is never necessary on Windows.)
- extend existing exceptions with their Windows variants.
- `lib/formdata.c`: prioritize `_fseeki64()` over `fseeko()`.
To reduce the difference between Windows builds, which now all use
`_fseeki64()`.
- cmake: perm-enable `HAVE_DIRENT_H` and `HAVE_OPENDIR` for mingw-w64,
to match configure.
Follow-up to bfe54b0e88239da542493321e795cd71c14af9cc #13137
This in theory could make the dir listing feature work in mingw-w64
build, but in my tests (on WINE) it failed at the preceding `open()`
call.
- cmake: perm-enable `HAVE_STRINGS_H` and `HAVE_UTIME_H` for mingw-w64,
to match configure. (They are wrappers and make no difference in the build.)

Also:
- configure: sync `USE_MANUAL` macro with cmake, by only setting it for
`src`. Drop checker exception.
- CI: use `--disable-dependency-tracking` in existing jobs.
- CI: install packages before git checkout, in existing jobs.

Closes #14678

show more ...


# 8b091380 19-Aug-2024 Viktor Szakats

cmake: minor tidy-ups

- show `OpenSSL v3+` when detected (as in `./configure`).
(this string also makes its way to `curl-config`.)
- prefer `unset(VAR)` over `set(VAR)`.
Same

cmake: minor tidy-ups

- show `OpenSSL v3+` when detected (as in `./configure`).
(this string also makes its way to `curl-config`.)
- prefer `unset(VAR)` over `set(VAR)`.
Same effect, but `unset()` tells the intent unambiguously.
https://cmake.org/cmake/help/latest/command/set.html
- drop "implementation" from an `option()` description.
- FindGSS: replace legacy keyword alias with modern alternative.
https://cmake.org/cmake/help/latest/command/get_filename_component.html
- move `CURL_STATIC_CRT` logic next to its `option()`.
- improve order of `libcurl.pc`/`curl-config` variable init lines.
- tests: drop/shorten custom target names.
They inflated generated make files by 550KB.
Keep target name logic for sync between code snippets.
Follow-up to a2ef5d36b3cdec8120a4a9b782d18d58a70d4236 #14660
- clear a variable after use.
- restore `STATUS` for `Features:`/`Protocols:` `message()`s:
Without it the output goes to stderr, and appears in red in CMake GUI.
It doesn't seem possible to show a line on stdout without leading
underscores to match `curl -V` and `./configure` output.
Partial revert of acbc6b703f6b0ee568d053f6f2565fbc107b5fd3 #14197
- WindowsCache: move `HAVE_LINUX_TCP_H` into the header group.
- move strings to the same line as their `STRING` keyword.
- formatting in generated code.
- delete bogus comment.
- unfold lines for readability.
- fix a too long line. (for cmakelint)
- missing quotes, whitespace, comments.

Closes #14610

show more ...


# cfd6f43d 06-Jul-2024 Viktor Szakats

build: tidy up `__builtin_available` feature checks (Apple)

- sync detection snippet between autotools and cmake
It wasn't causing issues, but it's useful to avoid unnecessary
di

build: tidy up `__builtin_available` feature checks (Apple)

- sync detection snippet between autotools and cmake
It wasn't causing issues, but it's useful to avoid unnecessary
differences while debugging.

- cmake: limit check to `APPLE`.

Ref: b05dc7eb3592305de9fa85640767f3dd2a8d4c93 #14122
Cherry-picked from #14097
Closes #14127

show more ...


# 23fe1a52 01-Jun-2024 Andy Pan

socketpair: add `eventfd` and use `SOCK_NONBLOCK` for `socketpair()`

Currently, we use `pipe` for `wakeup_create`, which requires ***two***
file descriptors. Furthermore, given its compl

socketpair: add `eventfd` and use `SOCK_NONBLOCK` for `socketpair()`

Currently, we use `pipe` for `wakeup_create`, which requires ***two***
file descriptors. Furthermore, given its complexity inside, `pipe` is a
bit heavyweight for just a simple event wait/notify mechanism.

`eventfd` would be a more suitable solution for this kind of scenario,
kernel also advocates for developers to use `eventfd` instead of `pipe`
in some simple use cases:

Applications can use an eventfd file descriptor instead of a pipe
(see pipe(2) in all cases where a pipe is used simply to signal
events. The kernel overhead of an eventfd file descriptor is much
lower than that of a pipe, and only one file descriptor is required
(versus the two required for a pipe).

This change adds the new backend of `eventfd` for `wakeup_create` and
uses it where available, eliminating the overhead of `pipe`. Also, it
optimizes the `wakeup_create` to eliminate the system calls that make
file descriptors non-blocking by moving the logic of setting
non-blocking flags on file descriptors to `socketpair.c` and using
`SOCK_NONBLOCK` for `socketpair(2)`, `EFD_NONBLOCK` for `eventfd(2)`.

Ref:
https://man7.org/linux/man-pages/man7/pipe.7.html
https://man7.org/linux/man-pages/man2/eventfd.2.html
https://man7.org/linux/man-pages/man2/socketpair.2.html
https://www.gnu.org/software/gnulib/manual/html_node/eventfd.html

Closes #13874

show more ...


# bfe54b0e 16-Mar-2024 Colin Leroy-Mira

file: add support for getting basic directory listings

Not supported on Windows (yet)

Closes #13137


# 7e8fdad2 12-Dec-2023 Viktor Szakats

cmake: prefill/cache `HAVE_STRUCT_SOCKADDR_STORAGE`

Also add missing include to `OtherTests.cmake`. It didn't cause an issue
because the parent already included this earlier by chance.

cmake: prefill/cache `HAVE_STRUCT_SOCKADDR_STORAGE`

Also add missing include to `OtherTests.cmake`. It didn't cause an issue
because the parent already included this earlier by chance.

Closes #12537

show more ...


# 60359ad5 06-Nov-2023 Viktor Szakats

build: delete `HAVE_STDINT_H` and `HAVE_INTTYPES_H`

We use `stdint.h` unconditionally in all places except one. These uses
are imposed by external dependencies / features. nghttp2, quic,

build: delete `HAVE_STDINT_H` and `HAVE_INTTYPES_H`

We use `stdint.h` unconditionally in all places except one. These uses
are imposed by external dependencies / features. nghttp2, quic, wolfSSL
and `HAVE_MACH_ABSOLUTE_TIME` do require this C99 header. It means that
any of these features make curl require a C99 compiler. (In case of
MSVC, this means Visual Studio 2010 or newer.)

This patch changes the single use of `stdint.h` guarded by
`HAVE_STDINT_H` to use `stdint.h` unconditionally. Also stop using
`inttypes.h` as an alternative there. `HAVE_INTTYPES_H` wasn't used
anywhere else, allowing to delete this feature check as well.

Closes #12275

show more ...


# 960d6014 28-Oct-2023 Viktor Szakats

build: require Windows XP or newer

After this patch we assume availability of `getaddrinfo` and
`freeaddrinfo`, first introduced in Windows XP. Meaning curl
now requires building for

build: require Windows XP or newer

After this patch we assume availability of `getaddrinfo` and
`freeaddrinfo`, first introduced in Windows XP. Meaning curl
now requires building for Windows XP as a minimum.

TODO: assume these also in autotools.

Ref: https://github.com/curl/curl/pull/12221#issuecomment-1783761806
Closes #12225

show more ...


# a426b505 13-Oct-2023 Viktor Szakats

build: variadic macro tidy-ups

- delete unused `HAVE_VARIADIC_MACROS_C99/GCC` feature checks.
(both autotools and CMake.)
- delete duplicate `NULL` check in `Curl_trc_cf_infof()`.

build: variadic macro tidy-ups

- delete unused `HAVE_VARIADIC_MACROS_C99/GCC` feature checks.
(both autotools and CMake.)
- delete duplicate `NULL` check in `Curl_trc_cf_infof()`.
- fix compiler warning in `CURL_DISABLE_VERBOSE_STRINGS` builds.
```
./lib/cf-socket.c:122:41: warning: unused parameter 'data' [-Wunused-parameter]
static void nosigpipe(struct Curl_easy *data,
^
```
- fix `#ifdef` comments in `lib/curl_trc.{c,h}`.
- fix indentation in some `infof()` calls.

Follow-up to dac293cfb7026b1ca4175d88b80f1432d3d3c684 #12167

Cherry-picked from #12105
Closes #12210

show more ...


# 2100d9fd 05-Oct-2023 Viktor Szakats

cmake: pre-fill rest of detection values for Windows

The goal of this patch is to avoid unnecessary feature detection work
when doing Windows builds with CMake. Do this by pre-filling we

cmake: pre-fill rest of detection values for Windows

The goal of this patch is to avoid unnecessary feature detection work
when doing Windows builds with CMake. Do this by pre-filling well-known
detection results for Windows and specifically for mingw-w64 and MSVC
compilers. Also limit feature checks to platforms where the results are
actually used. Drop a few redundant ones. And some tidying up.

- pre-fill remaining detection values in Windows CMake builds.

Based on actual detection results observed in CI runs, preceding
similar work over libssh2 and matching up values with
`lib/config-win32.h`.

This brings down CMake configuration time from 58 to 14 seconds on the
same local machine.

On AppVeyor CI this translates to:
- 128 seconds -> 50 seconds VS2022 MSVC with OpenSSL (per CMake job):
https://ci.appveyor.com/project/curlorg/curl/builds/48208419/job/4gw66ecrjpy7necb#L296
https://ci.appveyor.com/project/curlorg/curl/builds/48217440/job/8m4fwrr2fe249uo8#L186
- 62 seconds -> 16 seconds VS2017 MINGW (per CMake job):
https://ci.appveyor.com/project/curlorg/curl/builds/48208419/job/s1y8q5ivlcs7ub29?fullLog=true#L290
https://ci.appveyor.com/project/curlorg/curl/builds/48217440/job/pchpxyjsyc9kl13a?fullLog=true#L194

The formula is about 1-3 seconds delay for each detection. Almost all
of these trigger a full compile-link cycle behind the scenes, slow
even today, both cross and native, mingw-w64 and apparently MSVC too.
Enabling .map files or other custom build features slows it down
further. (Similar is expected for autotools configure.)

- stop detecting `idn2.h` if idn2 was deselected.
autotools does this.

- stop detecting `idn2.h` if idn2 was not found.
This deviates from autotools. Source code requires both header and
lib, so this is still correct, but faster.

- limit `ADDRESS_FAMILY` detection to Windows.

- normalize `HAVE_WIN32_WINNT` value to lowercase `0x0a12` format.

- pre-fill `HAVE_WIN32_WINNT`-dependent detection results.
Saving 4 (slow) feature-detections in most builds: `getaddrinfo`,
`freeaddrinfo`, `inet_ntop`, `inet_pton`

- fix pre-filled `HAVE_SYS_TIME_H`, `HAVE_SYS_PARAM_H`,
`HAVE_GETTIMEOFDAY` for mingw-w64.
Luckily this do not change build results, as `WIN32` took
priority over `HAVE_GETTIMEOFDAY` with the current source
code.

- limit `HAVE_CLOCK_GETTIME_MONOTONIC_RAW` and
`HAVE_CLOCK_GETTIME_MONOTONIC` detections to non-Windows.
We're not using these in the source code for Windows.

- reduce compiler warning noise in CMake internal logs:
- fix to include `winsock2.h` before `windows.h`.
Apply it to autotools test snippets too.
- delete previous `-D_WINSOCKAPI_=` hack that aimed to fix the above.
- cleanup `CMake/CurlTests.c` to emit less warnings.

- delete redundant `HAVE_MACRO_SIGSETJMP` feature check.
It was the same check as `HAVE_SIGSETJMP`.

- delete 'experimental' marking from `CURL_USE_OPENSSL`.

- show CMake version via `CMakeLists.txt`.
Credit to the `zlib-ng` project for the idea:
https://github.com/zlib-ng/zlib-ng/blob/61e181c8ae93dbf56040336179c9954078bd1399/CMakeLists.txt#L7

- make `CMake/CurlTests.c` pass `checksrc`.

- `CMake/WindowsCache.cmake` tidy-ups.

- replace `WIN32` guard with `_WIN32` in `CMake/CurlTests.c`.

Closes #12044

show more ...


# fa95f7ee 01-Oct-2023 Viktor Szakats

cmake: pre-cache `HAVE_POLL_FINE` on Windows

Windows doesn't support `poll()`, so we can safely skip checking for
fine poll.

Closes #12003


# f85dcaa6 30-Sep-2023 Viktor Szakats

cmake: detect `sys/wait.h` and `netinet/udp.h`

Ref: #11964 (effort to sync cmake detections with autotools)

Closes #11996


# da5dcb70 29-Sep-2023 Viktor Szakats

cmake: detect `HAVE_CLOCK_GETTIME_MONOTONIC_RAW`

Based on existing autotools logic.

Ref: #11964 (effort to sync cmake detections with autotools)

Closes #11981


# 14b74560 28-Sep-2023 Viktor Szakats

cmake: pre-cache `HAVE_BASENAME` for mingw-w64 and MSVC

`basename` is present in mingw-w64, missing from MSVC. Pre-cache
accordingly to make configure faster.

Notice that `basen

cmake: pre-cache `HAVE_BASENAME` for mingw-w64 and MSVC

`basename` is present in mingw-w64, missing from MSVC. Pre-cache
accordingly to make configure faster.

Notice that `basename` has a bug so we later disable it even with
mingw-w64:
https://github.com/curl/curl/blob/781242ffa44a9f9b95b6da5ac5a1bf6372ec6257/lib/curl_setup.h#L820-L825

Closes #11974

show more ...


# 9b517c8b 27-Sep-2023 Daniel Stenberg

cmake: add missing checks

- check for arc4random. To make rand.c use it accordingly.
- check for fcntl
- fix fseek detection
- add SIZEOF_CURL_SOCKET_T
- fix USE_UNIX_SOCKETS

cmake: add missing checks

- check for arc4random. To make rand.c use it accordingly.
- check for fcntl
- fix fseek detection
- add SIZEOF_CURL_SOCKET_T
- fix USE_UNIX_SOCKETS
- define HAVE_SNPRINTF to 1
- check for fnmatch
- check for sched_yield
- remove HAVE_GETPPID duplicate from curl_config.h
- add HAVE_SENDMSG

Ref: #11964

Co-authored-by: Viktor Szakats
Closes #11973

show more ...


# db07376a 28-Sep-2023 Daniel Stenberg

lib: remove TIME_WITH_SYS_TIME

It is not used in any code anywhere.

Ref: #11964
Closes #11975


# 1411c5eb 25-Sep-2023 Viktor Szakats

cmake: add feature checks for `memrchr` and `getifaddrs`

- `HAVE_MEMRCHR` for `memrchr`.
- `HAVE_GETIFADDRS` for `getifaddrs`.
This was present in `lib/curl_config.h.cmake` but mis

cmake: add feature checks for `memrchr` and `getifaddrs`

- `HAVE_MEMRCHR` for `memrchr`.
- `HAVE_GETIFADDRS` for `getifaddrs`.
This was present in `lib/curl_config.h.cmake` but missed the detection
logic.

To match existing autotools feature checks.

Closes #11954

show more ...


# 8e74c072 26-Sep-2023 Viktor Szakats

cmake: assume `_fseeki64` and no `fseeko` on Windows

`_fseeki64` is present in mingw-w64 1.0 (2011-09-26) headers, and
at least Watcom C 1.9 (2010) headers and MSVS 2008 [1].

`f

cmake: assume `_fseeki64` and no `fseeko` on Windows

`_fseeki64` is present in mingw-w64 1.0 (2011-09-26) headers, and
at least Watcom C 1.9 (2010) headers and MSVS 2008 [1].

`fseeko` is not present in any of these.

(mingw-w64 1.0 also offers `fseeko64`.)

[1] https://github.com/curl/curl/pull/11944#issuecomment-1734995004

Follow-up to 9c7165e96a3a9a2d0b7059c87c699b5ca8cdae93 #11918

Closes #11950

show more ...


# 96c29900 25-Sep-2023 Viktor Szakats

build: delete checks for C89 standard headers

Delete checks and guards for standard C89 headers and assume these are
available: `stdio.h`, `string.h`, `time.h`, `setjmp.h`, `stdlib.h`,

build: delete checks for C89 standard headers

Delete checks and guards for standard C89 headers and assume these are
available: `stdio.h`, `string.h`, `time.h`, `setjmp.h`, `stdlib.h`,
`stddef.h`, `signal.h`.

Some of these we already used unconditionally, some others we only used
for feature checks.

Follow-up to 9c7165e96a3a9a2d0b7059c87c699b5ca8cdae93 #11918 (for `stdio.h` in CMake)

Closes #11940

show more ...


# bbac7c19 20-Sep-2023 Patrick Monnerat

tftpd: always use curl's own tftp.h

Using the system's provided arpa/tftp.h and optimizing, GCC 12 detects
and reports a stringop-overread warning:

tftpd.c: In function ‘write_b

tftpd: always use curl's own tftp.h

Using the system's provided arpa/tftp.h and optimizing, GCC 12 detects
and reports a stringop-overread warning:

tftpd.c: In function ‘write_behind.isra’:
tftpd.c:485:12: warning: ‘write’ reading between 1 and 2147483647 bytes from a region of size 0 [-Wstringop-overread]
485 | return write(test->ofile, writebuf, count);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from tftpd.c:71:
/usr/include/arpa/tftp.h:58:30: note: source object ‘tu_data’ of size 0
58 | char tu_data[0]; /* data or error string */
| ^~~~~~~

This occurs because writebuf points to this field and the latter
cannot be considered as being of dynamic length because it is not
the last field in the structure. Thus it is bound to its declared
size.

This commit always uses curl's own version of tftp.h where the
target field is last in its structure, effectively avoiding the
warning.

As HAVE_ARPA_TFTP_H is not used anymore, cmake/configure checks for
arpa/tftp.h are removed.

Closes #11897

show more ...


123