Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit cdd21f8

Browse files
authored
Fix use of nested designators (#45869)
There was an internal global change which turned `-Wc99-designator`. This causes the following error: ``` error: nested designators are a C99 extension [-Werror,-Wc99-designator] 65 | .metal.struct_size = sizeof(FlutterMetalRendererConfig), | ^~~~~~~~~~~~~~~~~~ ``` This seems like a trivial (?) fix, so perhaps we can fix it properly and possibly remove https://github.com/flutter/buildroot/blob/b9fbd310d6fa68f888738d5236ea2f6caa2d2bfc/build/config/compiler/BUILD.gn#L667 after this PR lands. *List which issues are fixed by this PR. You must list at least one issue.* b/300573112 *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].* [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
1 parent bfd2ffb commit cdd21f8

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

shell/platform/darwin/macos/framework/Source/FlutterRenderer.mm

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,17 @@ - (instancetype)initWithFlutterEngine:(nonnull FlutterEngine*)flutterEngine {
6262
- (FlutterRendererConfig)createRendererConfig {
6363
FlutterRendererConfig config = {
6464
.type = FlutterRendererType::kMetal,
65-
.metal.struct_size = sizeof(FlutterMetalRendererConfig),
66-
.metal.device = (__bridge FlutterMetalDeviceHandle)_device,
67-
.metal.present_command_queue = (__bridge FlutterMetalCommandQueueHandle)_commandQueue,
68-
.metal.get_next_drawable_callback =
69-
reinterpret_cast<FlutterMetalTextureCallback>(OnGetNextDrawable),
70-
.metal.present_drawable_callback =
71-
reinterpret_cast<FlutterMetalPresentCallback>(OnPresentDrawable),
72-
.metal.external_texture_frame_callback =
73-
reinterpret_cast<FlutterMetalTextureFrameCallback>(OnAcquireExternalTexture),
74-
};
65+
.metal = {
66+
.struct_size = sizeof(FlutterMetalRendererConfig),
67+
.device = (__bridge FlutterMetalDeviceHandle)_device,
68+
.present_command_queue = (__bridge FlutterMetalCommandQueueHandle)_commandQueue,
69+
.get_next_drawable_callback =
70+
reinterpret_cast<FlutterMetalTextureCallback>(OnGetNextDrawable),
71+
.present_drawable_callback =
72+
reinterpret_cast<FlutterMetalPresentCallback>(OnPresentDrawable),
73+
.external_texture_frame_callback =
74+
reinterpret_cast<FlutterMetalTextureFrameCallback>(OnAcquireExternalTexture),
75+
}};
7576
return config;
7677
}
7778

0 commit comments

Comments
 (0)