Skip to content

Commit

Permalink
Fix GoogleUtilities regression for Firestore builds 2 (#2433)
Browse files Browse the repository at this point in the history
* Run Firestore builds/tests on GoogleUtilities changes
* Silence macOS 10.10 warnings
* Add cast to fix Firestore macOS builds
  • Loading branch information
paulb777 committed Feb 23, 2019
1 parent 9c41c87 commit f76ae21
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
4 changes: 4 additions & 0 deletions GoogleUtilities/Logger/GULLogger.m
Expand Up @@ -19,6 +19,10 @@
#import "GULLoggerLevel.h"
#import "GULOSLogger.h"

#if TARGET_OS_IOS
#import <UIKit/UIKit.h>
#endif

static id<GULLoggerSystem> sGULLogger;

NSString *const kGULLoggerInvalidLoggerLevelCore = @"I-COR000023";
Expand Down
20 changes: 19 additions & 1 deletion GoogleUtilities/Logger/Private/GULOSLogger.m
Expand Up @@ -22,6 +22,10 @@
#import "GULLogger+Internal.h"
#import "GULLoggerLevel.h"

#if TARGET_OS_IOS
#import <UIKit/UIKit.h>
#endif

NS_ASSUME_NONNULL_BEGIN

// Function which calls the macro so that this can be substituted for testing.
Expand All @@ -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 {
Expand Down Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions scripts/if_changed.sh
Expand Up @@ -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)'
;;

*)
Expand Down

0 comments on commit f76ae21

Please sign in to comment.