From: Viktor Szakats Date: Wed, 30 Oct 2024 20:09:06 +0000 (+0100) Subject: unit1307: tidy up Apple OS detection X-Git-Tag: curl-8_11_0~19 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=329a8e9daa1bcc2dd525fe5d4d27d13d39fed69e;p=thirdparty%2Fcurl.git 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 --- diff --git a/tests/unit/unit1307.c b/tests/unit/unit1307.c index 203cdd2ee3..08faa33903 100644 --- a/tests/unit/unit1307.c +++ b/tests/unit/unit1307.c @@ -280,11 +280,11 @@ UNITTEST_START enum system machine; #ifdef HAVE_FNMATCH - if(strstr(CURL_OS, "apple") || strstr(CURL_OS, "darwin")) { - machine = SYSTEM_MACOS; - } - else - machine = SYSTEM_LINUX; +#ifdef __APPLE__ + machine = SYSTEM_MACOS; +#else + machine = SYSTEM_LINUX; +#endif printf("Tested with system fnmatch(), %s-style\n", machine == SYSTEM_LINUX ? "linux" : "mac"); #else