summaryrefslogtreecommitdiff
path: root/lib/curl_config.h.cmake
diff options
context:
space:
mode:
authorViktor Szakats <commit@vsz.me>2022-11-01 22:27:28 +0000
committerViktor Szakats <commit@vsz.me>2022-11-01 22:27:28 +0000
commitb563a92cd6797ec40d7cd73d51f9c31e637463f4 (patch)
tree47afd98d829bf281aac506c010f7355537b014d5 /lib/curl_config.h.cmake
parent480ac6e54daa1df1bf17a95931eab412e26bd608 (diff)
downloadcurl-b563a92cd6797ec40d7cd73d51f9c31e637463f4.tar.gz
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
Diffstat (limited to 'lib/curl_config.h.cmake')
-rw-r--r--lib/curl_config.h.cmake3
1 files changed, 0 insertions, 3 deletions
diff --git a/lib/curl_config.h.cmake b/lib/curl_config.h.cmake
index 2ce4a43c0..e12d48901 100644
--- a/lib/curl_config.h.cmake
+++ b/lib/curl_config.h.cmake
@@ -595,9 +595,6 @@
/* Define to 1 if you have the ws2tcpip.h header file. */
#cmakedefine HAVE_WS2TCPIP_H 1
-/* Define if you have the <process.h> header file. */
-#cmakedefine HAVE_PROCESS_H 1
-
/* Define to 1 if you need the lber.h header file even with ldap.h */
#cmakedefine NEED_LBER_H 1