Check whether TARGET_OS_* defines are defined before checking their value to fix build failure of software that uses tidy on Mac OS X 10.6 (which doesn't define these) when using clang 11 or later (which MacPorts now does) and remove incorrect use of TARGET_OS_MAC. https://github.com/htacg/tidy-html5/issues/1030 --- include/tidyplatform.h.orig 2021-07-10 15:53:56.000000000 -0500 +++ include/tidyplatform.h 2022-03-23 03:03:02.000000000 -0500 @@ -115,16 +115,18 @@ # define MAC_OS_X # ifndef PLATFORM_NAME # include "TargetConditionals.h" -# if TARGET_OS_IOS -# define PLATFORM_NAME "Apple iOS" -# elif TARGET_OS_MAC -# define PLATFORM_NAME "Apple macOS" -# elif TARGET_OS_TV -# define PLATFORM_NAME "Apple tvOS" -# elif TARGET_OS_WATCH -# define PLATFORM_NAME "Apple watchOS" +# if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE +# if defined(TARGET_OS_MACCATALYST) && TARGET_OS_MACCATALYST +# define PLATFORM_NAME "Apple macOS" +# elif defined(TARGET_OS_TV) && TARGET_OS_TV +# define PLATFORM_NAME "Apple tvOS" +# elif defined(TARGET_OS_WATCH) && TARGET_OS_WATCH +# define PLATFORM_NAME "Apple watchOS" +# else +# define PLATFORM_NAME "Apple iOS" +# endif # else -# define PLATFORM_NAME "Apple Unknown OS" +# define PLATFORM_NAME "Apple macOS" # endif # endif #endif