Skip to content

Commit f48a4a8

Browse files
Fix build issues on Darwin.
NSUinteger is different sizes on different Darwin targets, so we have to be a bit careful when logging it.
1 parent fa9bfbd commit f48a4a8

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

.github/workflows/darwin.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ jobs:
4949
- name: Validate zap-cli is NOT available
5050
# run_in_build_env.sh is used to ensure PATH is set to something that would otherwise find zap-cli
5151
run: scripts/run_in_build_env.sh '(zap-cli --version && exit 1) || exit 0'
52+
- name: Run watchOS Build Debug
53+
working-directory: src/darwin/Framework
54+
# Disable availability annotations, since we are not building a system
55+
# Matter.framework.
56+
run: xcodebuild -target "Matter" -sdk watchos -configuration Debug GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1'
5257
- name: Run iOS Build Debug
5358
working-directory: src/darwin/Framework
5459
# Disable availability annotations, since we are not building a system

src/darwin/Framework/CHIP/MTRDevice.mm

+2-2
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,7 @@ - (void)_handleEventReport:(NSArray<NSDictionary<NSString *, id> *> *)eventRepor
939939
}
940940
}
941941
}
942-
MTR_LOG_INFO("%@ _getCachedDataVersions dataVersions count: %lu readCache count: %lu", self, dataVersions.count, _readCache.count);
942+
MTR_LOG_INFO("%@ _getCachedDataVersions dataVersions count: %lu readCache count: %lu", self, static_cast<unsigned long>(dataVersions.count), static_cast<unsigned long>(_readCache.count));
943943
os_unfair_lock_unlock(&self->_lock);
944944

945945
return dataVersions;
@@ -1996,7 +1996,7 @@ - (NSArray *)_getAttributesToReportWithReportedValues:(NSArray<NSDictionary<NSSt
19961996

19971997
- (void)setAttributeValues:(NSArray<NSDictionary *> *)attributeValues reportChanges:(BOOL)reportChanges
19981998
{
1999-
MTR_LOG_INFO("%@ setAttributeValues count: %lu reportChanges: %d", self, attributeValues.count, reportChanges);
1999+
MTR_LOG_INFO("%@ setAttributeValues count: %lu reportChanges: %d", self, static_cast<unsigned long>(attributeValues.count), reportChanges);
20002000
os_unfair_lock_lock(&self->_lock);
20012001

20022002
if (reportChanges) {

src/darwin/Framework/CHIP/MTRDeviceController.mm

+1-1
Original file line numberDiff line numberDiff line change
@@ -887,7 +887,7 @@ - (MTRDevice *)deviceForNodeID:(NSNumber *)nodeID
887887

888888
// Load persisted attributes if they exist.
889889
NSArray * attributesFromCache = [_controllerDataStore getStoredAttributesForNodeID:nodeID];
890-
MTR_LOG_INFO("Loaded %lu attributes from storage for %@", attributesFromCache.count, deviceToReturn);
890+
MTR_LOG_INFO("Loaded %lu attributes from storage for %@", static_cast<unsigned long>(attributesFromCache.count), deviceToReturn);
891891
if (attributesFromCache.count) {
892892
[deviceToReturn setAttributeValues:attributesFromCache reportChanges:NO];
893893
}

0 commit comments

Comments
 (0)