Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable TAPI_VERIFY_MODE=Pedantic. #27424

Merged
merged 1 commit into from
Jun 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/darwin/Framework/CHIP/MTRBaseDevice.mm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#import <Matter/MTRDefines.h>

#import "MTRAttributeTLVValueDecoder_Internal.h"
#import "MTRBaseDevice_Internal.h"
Expand Down Expand Up @@ -86,6 +87,7 @@

class MTRDataValueDictionaryCallbackBridge;

MTR_HIDDEN
@interface MTRReadClientContainer : NSObject
@property (nonatomic, readwrite) app::ReadClient * readClientPtr;
@property (nonatomic, readwrite) app::AttributePathParams * pathParams;
Expand Down
2 changes: 2 additions & 0 deletions src/darwin/Framework/CHIP/MTRCommissionableBrowser.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@
*/

#import <Foundation/Foundation.h>
#import <Matter/MTRDefines.h>

NS_ASSUME_NONNULL_BEGIN

@protocol MTRCommissionableBrowserDelegate;

MTR_HIDDEN
@interface MTRCommissionableBrowser : NSObject
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)new NS_UNAVAILABLE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@
*/

#import <Foundation/Foundation.h>
#import <Matter/MTRDefines.h>

#import "MTRCommissionableBrowserResult.h"

#include <controller/SetUpCodePairer.h>

NS_ASSUME_NONNULL_BEGIN

MTR_HIDDEN
@interface MTRCommissionableBrowserResultInterfaces : NSObject

@property (nonatomic, readwrite) chip::Optional<chip::Dnssd::CommonResolutionData> resolutionData;
Expand Down
2 changes: 2 additions & 0 deletions src/darwin/Framework/CHIP/MTRControllerAccessControl.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@
#pragma once

#import <Foundation/Foundation.h>
#import <Matter/MTRDefines.h>

NS_ASSUME_NONNULL_BEGIN

MTR_HIDDEN
@interface MTRControllerAccessControl : NSObject

- (instancetype)init NS_UNAVAILABLE;
Expand Down
2 changes: 2 additions & 0 deletions src/darwin/Framework/CHIP/MTRDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

#define MTR_EXPORT __attribute__((visibility("default")))

#define MTR_HIDDEN __attribute__((visibility("hidden")))

#ifdef __cplusplus
#define MTR_EXTERN extern "C" MTR_EXPORT
#else
Expand Down
2 changes: 2 additions & 0 deletions src/darwin/Framework/CHIP/MTRDevice.mm
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* limitations under the License.
*/

#import <Matter/MTRDefines.h>
#import <os/lock.h>

#import "MTRAsyncCallbackWorkQueue_Internal.h"
Expand Down Expand Up @@ -44,6 +45,7 @@
// Consider moving utility classes to their own file
#pragma mark - Utility Classes
// This class is for storing weak references in a container
MTR_HIDDEN
@interface MTRWeakReference<ObjectType> : NSObject
+ (instancetype)weakReferenceWithObject:(ObjectType)object;
- (instancetype)initWithObject:(ObjectType)object;
Expand Down
4 changes: 4 additions & 0 deletions src/darwin/Framework/CHIP/MTRDeviceController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#import <Matter/MTRDefines.h>

#import "MTRDeviceController_Internal.h"

#import "MTRBaseDevice_Internal.h"
Expand Down Expand Up @@ -1021,6 +1023,7 @@ - (void)operationalInstanceAdded:(chip::NodeId)nodeID
* Shim to allow us to treat an MTRDevicePairingDelegate as an
* MTRDeviceControllerDelegate.
*/
MTR_HIDDEN
@interface MTRDevicePairingDelegateShim : NSObject <MTRDeviceControllerDelegate>
@property (nonatomic, readonly) id<MTRDevicePairingDelegate> delegate;
- (instancetype)initWithDelegate:(id<MTRDevicePairingDelegate>)delegate;
Expand Down Expand Up @@ -1078,6 +1081,7 @@ - (void)onPairingDeleted:(NSError * _Nullable)error
* Shim to allow us to treat an MTRNOCChainIssuer as an
* MTROperationalCertificateIssuer.
*/
MTR_HIDDEN
@interface MTROperationalCertificateChainIssuerShim : NSObject <MTROperationalCertificateIssuer>
@property (nonatomic, readonly) id<MTRNOCChainIssuer> nocChainIssuer;
@property (nonatomic, readonly) BOOL shouldSkipAttestationCertificateValidation;
Expand Down
2 changes: 2 additions & 0 deletions src/darwin/Framework/CHIP/MTRDeviceControllerOverXPC.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* limitations under the License.
*/

#import <Matter/MTRDefines.h>
#import <Matter/MTRDeviceController.h>

NS_ASSUME_NONNULL_BEGIN
Expand All @@ -23,6 +24,7 @@ NS_ASSUME_NONNULL_BEGIN

typedef NSXPCConnection * _Nonnull (^MTRXPCConnectBlock)(void);

MTR_HIDDEN
@interface MTRDeviceControllerOverXPC : MTRDeviceController

- (instancetype)init NS_UNAVAILABLE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#import "MTRDeviceControllerStartupParams.h"
#import <Foundation/Foundation.h>
#import <Matter/MTRDefines.h>

#include <crypto/CHIPCryptoPAL.h>
#include <lib/core/DataModelTypes.h>
Expand All @@ -42,6 +43,7 @@ NS_ASSUME_NONNULL_BEGIN
- (instancetype)initWithParams:(MTRDeviceControllerStartupParams *)params;
@end

MTR_HIDDEN
@interface MTRDeviceControllerStartupParamsInternal : MTRDeviceControllerStartupParams

// Fabric table we can use to do things like allocate operational keys.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* limitations under the License.
*/

#import <Matter/MTRDefines.h>

#import "MTRDeviceController+XPC.h"

NS_ASSUME_NONNULL_BEGIN
Expand All @@ -27,6 +29,7 @@ typedef void (^MTRXPCReportHandler)(id _Nullable values, NSError * _Nullable err
* Releasing the handle may cause invalidating the XPC connection. Hence, in order to retain the connection, the handle must not be
* released.
*/
MTR_HIDDEN
@interface MTRDeviceControllerXPCProxyHandle : NSObject

@property (nonatomic, readonly, getter=proxy) id<MTRDeviceControllerServerProtocol> proxy;
Expand All @@ -40,6 +43,7 @@ typedef void (^MTRGetProxyHandleHandler)(dispatch_queue_t queue, MTRDeviceContro
*
* This class is in charge of making a new XPC connection and disconnecting as needed by the clients and by the report handlers.
*/
MTR_HIDDEN
@interface MTRDeviceControllerXPCConnection<MTRDeviceControllerClientProtocol> : NSObject

/**
Expand Down
3 changes: 3 additions & 0 deletions src/darwin/Framework/CHIP/MTRDeviceOverXPC.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* limitations under the License.
*/

#import <Matter/MTRDefines.h>

#import "MTRBaseDevice.h"
#import "MTRCluster.h" // For MTRSubscriptionEstablishedHandler
#import "MTRDeviceControllerXPCConnection.h"
Expand All @@ -23,6 +25,7 @@

NS_ASSUME_NONNULL_BEGIN

MTR_HIDDEN
@interface MTRDeviceOverXPC : MTRBaseDevice

- (instancetype)init NS_UNAVAILABLE;
Expand Down
3 changes: 3 additions & 0 deletions src/darwin/Framework/CHIP/MTRError.mm
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* limitations under the License.
*/

#import <Matter/MTRDefines.h>

#import "MTRError.h"
#import "MTRError_Internal.h"

Expand All @@ -32,6 +34,7 @@

// Class for holding on to a CHIP_ERROR that we can use as the value
// in a dictionary.
MTR_HIDDEN
@interface MTRErrorHolder : NSObject
@property (nonatomic, readonly) CHIP_ERROR error;

Expand Down
2 changes: 2 additions & 0 deletions src/darwin/Framework/CHIP/MTRError_Internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@
*/

#import <Foundation/Foundation.h>
#import <Matter/MTRDefines.h>
#import <Matter/MTRError.h>

#include <app/MessageDef/StatusIB.h>
#include <lib/core/CHIPError.h>

NS_ASSUME_NONNULL_BEGIN

MTR_HIDDEN
@interface MTRError : NSObject
+ (NSError * _Nullable)errorForCHIPErrorCode:(CHIP_ERROR)errorCode;
+ (NSError * _Nullable)errorForIMStatus:(const chip::app::StatusIB &)status;
Expand Down
4 changes: 3 additions & 1 deletion src/darwin/Framework/CHIP/MTROTAProviderDelegateBridge.mm
Original file line number Diff line number Diff line change
Expand Up @@ -492,9 +492,11 @@ CHIP_ERROR ConfigureState(chip::FabricIndex fabricIndex, chip::NodeId nodeId)
uint64_t mTransferGeneration = 0;
};

namespace {
BdxOTASender gOtaSender;

static NSInteger const kOtaProviderEndpoint = 0;
NSInteger const kOtaProviderEndpoint = 0;
} // anonymous namespace

MTROTAProviderDelegateBridge::MTROTAProviderDelegateBridge(id<MTROTAProviderDelegate> delegate)
: mDelegate(delegate)
Expand Down
8 changes: 8 additions & 0 deletions src/darwin/Framework/Matter.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1753,6 +1753,7 @@
CoreBluetooth,
"-lnetwork",
"-Wl,-unexported_symbol,\"__Z*\"",
"-Wl,-hidden-lCHIP",
);
"OTHER_LDFLAGS[sdk=macosx*]" = (
"-framework",
Expand All @@ -1767,11 +1768,14 @@
"-framework",
CoreData,
"-Wl,-unexported_symbol,\"__Z*\"",
"-Wl,-hidden-lCHIP",
);
PRODUCT_BUNDLE_IDENTIFIER = com.csa.matter;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SDKROOT = iphoneos;
TAPI_VERIFY_MODE = Pedantic;
TARGETED_DEVICE_FAMILY = "1,2,3,4";
VERSION_INFO_EXPORT_DECL = "__attribute__((visibility(\"hidden\")))";
};
name = Debug;
};
Expand Down Expand Up @@ -1905,6 +1909,7 @@
CoreBluetooth,
"-lnetwork",
"-Wl,-unexported_symbol,\"__Z*\"",
"-Wl,-hidden-lCHIP",
);
"OTHER_LDFLAGS[sdk=macosx*]" = (
"-framework",
Expand All @@ -1919,12 +1924,15 @@
"-framework",
CoreData,
"-Wl,-unexported_symbol,\"__Z*\"",
"-Wl,-hidden-lCHIP",
);
PRODUCT_BUNDLE_IDENTIFIER = com.csa.matter;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SDKROOT = iphoneos;
STRIP_STYLE = "non-global";
TAPI_VERIFY_MODE = Pedantic;
TARGETED_DEVICE_FAMILY = "1,2,3,4";
VERSION_INFO_EXPORT_DECL = "__attribute__((visibility(\"hidden\")))";
};
name = Release;
};
Expand Down