unit1307: tidy up Apple OS detection

Use `__APPLE__` macro to detect Apple OS instead of relying on
the string in `CURL_OS`.

This also fixes detection with default CMake builds where `CURL_OS` is
`Darwin`. The code before this patch was expecting this substring in
lowercase.

Closes #15461
This commit is contained in:
Viktor Szakats 2024-10-30 21:09:06 +01:00
parent 9640a8ef6f
commit 329a8e9daa
No known key found for this signature in database
GPG Key ID: B5ABD165E2AEF201

View File

@ -280,11 +280,11 @@ UNITTEST_START
enum system machine; enum system machine;
#ifdef HAVE_FNMATCH #ifdef HAVE_FNMATCH
if(strstr(CURL_OS, "apple") || strstr(CURL_OS, "darwin")) { #ifdef __APPLE__
machine = SYSTEM_MACOS; machine = SYSTEM_MACOS;
} #else
else machine = SYSTEM_LINUX;
machine = SYSTEM_LINUX; #endif
printf("Tested with system fnmatch(), %s-style\n", printf("Tested with system fnmatch(), %s-style\n",
machine == SYSTEM_LINUX ? "linux" : "mac"); machine == SYSTEM_LINUX ? "linux" : "mac");
#else #else