Skip to content

Commit

Permalink
Use fixed-size types for Objective C enums/options. (#16264)
Browse files Browse the repository at this point in the history
This makes 64-bit cases work much better.
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Mar 24, 2022
1 parent 47d823d commit 1224336
Show file tree
Hide file tree
Showing 2 changed files with 185 additions and 185 deletions.
4 changes: 2 additions & 2 deletions src/darwin/Framework/CHIP/templates/CHIPClustersObjc.zapt
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEs

{{#zcl_clusters}}
{{#zcl_enums}}
typedef NS_ENUM(NSInteger, {{objCEnumName ../name label}}) {
typedef NS_ENUM({{asUnderlyingZclType type}}, {{objCEnumName ../name label}}) {
{{#zcl_enum_items}}
{{objCEnumName ../../name ../label}}{{objCEnumItemLabel label}} = {{asHex value 2}},
{{/zcl_enum_items}}
};

{{/zcl_enums}}
{{#zcl_bitmaps}}
typedef NS_OPTIONS(NSUInteger, {{objCEnumName ../name label}}) {
typedef NS_OPTIONS({{asUnderlyingZclType type}}, {{objCEnumName ../name label}}) {
{{#zcl_bitmap_items}}
{{objCEnumName ../../name ../label}}{{objCEnumItemLabel label}} = {{asHex mask}},
{{/zcl_bitmap_items}}
Expand Down
Loading

0 comments on commit 1224336

Please sign in to comment.