diff --git a/GoogleUtilities/Logger/GULLogger.m b/GoogleUtilities/Logger/GULLogger.m index 1cb37444b83..c77fd9fbada 100644 --- a/GoogleUtilities/Logger/GULLogger.m +++ b/GoogleUtilities/Logger/GULLogger.m @@ -19,6 +19,10 @@ #import "GULLoggerLevel.h" #import "GULOSLogger.h" +#if TARGET_OS_IOS +#import +#endif + static id sGULLogger; NSString *const kGULLoggerInvalidLoggerLevelCore = @"I-COR000023"; diff --git a/GoogleUtilities/Logger/Private/GULOSLogger.m b/GoogleUtilities/Logger/Private/GULOSLogger.m index 0058b15ba2e..c32f558d12b 100644 --- a/GoogleUtilities/Logger/Private/GULOSLogger.m +++ b/GoogleUtilities/Logger/Private/GULOSLogger.m @@ -22,6 +22,10 @@ #import "GULLogger+Internal.h" #import "GULLoggerLevel.h" +#if TARGET_OS_IOS +#import +#endif + NS_ASSUME_NONNULL_BEGIN // Function which calls the macro so that this can be substituted for testing. @@ -38,8 +42,14 @@ static void GULLOSLogWithType(os_log_t log, os_log_type_t type, char *s, ...) { va_start(args, s); #if TARGET_OS_TV os_log_with_type(log, type, "%s", (char *)args); +#elif TARGET_OS_OSX + // Silence macOS 10.10 warning until we move minimum to 10.11. +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunguarded-availability" + os_log_with_type(log, type, "%s", (char *)args); +#pragma clang diagnostic pop #else - os_log_with_type(log, type, "%s", args); + os_log_with_type(log, type, "%s", args); #endif va_end(args); } else { @@ -169,7 +179,15 @@ - (void)logWithLevel:(GULLoggerLevel)level #else if ([[UIDevice currentDevice].systemVersion integerValue] >= 9) { #endif +#if TARGET_OS_OSX + // Silence macOS 10.10 warning until we move minimum to 10.11. +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunguarded-availability" osLog = os_log_create(kGULLoggerClientFacilityName, service.UTF8String); +#pragma clang diagnostic pop +#else + osLog = os_log_create(kGULLoggerClientFacilityName, service.UTF8String); +#endif self.categoryLoggers[service] = osLog; } else { #ifdef DEBUG diff --git a/scripts/if_changed.sh b/scripts/if_changed.sh index 915230c8531..04bdf209a19 100755 --- a/scripts/if_changed.sh +++ b/scripts/if_changed.sh @@ -71,11 +71,12 @@ else ;; Firestore-xcodebuild|Firestore-pod-lib-lint) - check_changes '^(Firestore|FirebaseFirestore.podspec|FirebaseFirestoreSwift.podspec)' + check_changes '^(Firestore|FirebaseFirestore.podspec|FirebaseFirestoreSwift.podspec|'\ +'GoogleUtilities)' ;; Firestore-cmake) - check_changes '^(Firestore/(core|third_party)|cmake)' + check_changes '^(Firestore/(core|third_party)|cmake|GoogleUtilities)' ;; *)