From 329a8e9daa1bcc2dd525fe5d4d27d13d39fed69e Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 30 Oct 2024 21:09:06 +0100 Subject: [PATCH] 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 --- tests/unit/unit1307.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 -- 2.47.3