curl/lib/vtls
Viktor Szakats b563a92cd6
tidy-up: process.h detection and use
This patch aims to cleanup the use of `process.h` header and the macro
`HAVE_PROCESS_H` associated with it.

- `process.h` is always available on Windows. In curl, it is required
  only for `_beginthreadex()` in `lib/curl_threads.c`.

- `process.h` is also available in MS-DOS. In curl, its only use was in
  `lib/smb.c` for `getpid()`. But `getpid()` is in fact declared by
  `unistd.h`, which is always enabled via `lib/config-dos.h`. So the
  header is not necessary.

- `HAVE_PROCESS_H` was detected by CMake, forced to 1 on Windows and
  left to real detection for other platforms.
  It was also set to always-on in `lib/config-win32.h` and
  `lib/config-dos.h`.
  In autotools builds, there was no detection and the macro was never
  set.

Based on these observations, in this patch we:

- Rework Windows `getpid` logic in `lib/smb.c` to always use the
  equivalent direct Win32 API function `GetCurrentProcessId()`, as we
  already did for Windows UWP apps. This makes `process.h` unnecessary
  here on Windows.

- Stop #including `process.h` into files where it was not necessary.
  This is everywhere, except `lib/curl_threads.c`.

  > Strangely enough, `lib/curl_threads.c` compiled fine with autotools
  > because `process.h` is also indirecty included via `unistd.h`. This
  > might have been broken in autotools MSVC builds, where the latter
  > header is missing.

- Delete all remaining `HAVE_PROCESS_H` feature guards, for they were
  unnecessary.

- Delete `HAVE_PROCESS_H` detection from CMake and predefined values
  from `lib/config-*.h` headers.

Reviewed-by: Jay Satiro
Closes #9703
2022-11-01 22:27:28 +00:00
..
bearssl.c bearssl: make it proper C89 compliant 2022-09-23 08:27:50 +02:00
bearssl.h
gskit.c
gskit.h
gtls.c http, vauth: always provide Curl_allow_auth_to_host() functionality 2022-09-27 14:05:37 +02:00
gtls.h
hostcheck.c
hostcheck.h
keylog.c lib and tests: add missing curl.h includes 2022-09-12 09:41:47 +02:00
keylog.h
mbedtls_threadlock.c tidy-up: process.h detection and use 2022-11-01 22:27:28 +00:00
mbedtls_threadlock.h tidy-up: process.h detection and use 2022-11-01 22:27:28 +00:00
mbedtls.c NPN: remove support for and use of 2022-09-05 07:39:02 +02:00
mbedtls.h
nss.c misc: remove duplicated include files 2022-10-26 11:27:59 +02:00
nssg.h
openssl.c strcase: use curl_str(n)equal for case insensitive matches 2022-11-01 17:01:26 +01:00
openssl.h openssl: make certinfo available for QUIC 2022-09-27 14:02:27 +02:00
rustls.c NPN: remove support for and use of 2022-09-05 07:39:02 +02:00
rustls.h
schannel_verify.c
schannel.c style: use space after comment start and before comment end 2022-10-30 22:31:29 +01:00
schannel.h misc: remove duplicated include files 2022-10-26 11:27:59 +02:00
sectransp.c style: use space after comment start and before comment end 2022-10-30 22:31:29 +01:00
sectransp.h
vtls.c strcase: use curl_str(n)equal for case insensitive matches 2022-11-01 17:01:26 +01:00
vtls.h
wolfssl.c wolfSSL: fix session management bug. 2022-09-13 10:15:40 +02:00
wolfssl.h
x509asn1.c ctype: remove all use of <ctype.h>, use our own versions 2022-09-06 08:32:36 +02:00
x509asn1.h