diff --git a/packages/camera/camera_windows/CHANGELOG.md b/packages/camera/camera_windows/CHANGELOG.md index 1ff3ffe4186..7b0cca7134b 100644 --- a/packages/camera/camera_windows/CHANGELOG.md +++ b/packages/camera/camera_windows/CHANGELOG.md @@ -1,5 +1,6 @@ -## NEXT +## 0.2.6+2 +* Fixes compile errors under strict standards mode. * Updates minimum supported SDK version to Flutter 3.22/Dart 3.4. ## 0.2.6+1 diff --git a/packages/camera/camera_windows/example/windows/CMakeLists.txt b/packages/camera/camera_windows/example/windows/CMakeLists.txt index 28757c79ca2..60e4ea3a5f6 100644 --- a/packages/camera/camera_windows/example/windows/CMakeLists.txt +++ b/packages/camera/camera_windows/example/windows/CMakeLists.txt @@ -34,6 +34,9 @@ function(APPLY_STANDARD_SETTINGS TARGET) target_compile_features(${TARGET} PUBLIC cxx_std_17) target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") target_compile_options(${TARGET} PRIVATE /EHsc) + # Enable strict standards mode in the example app, since issues it finds + # may become errors by default in future compiler versions. + target_compile_options(${TARGET} PRIVATE /permissive-) target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") endfunction() diff --git a/packages/camera/camera_windows/pubspec.yaml b/packages/camera/camera_windows/pubspec.yaml index 474810845e0..d66f36f2550 100644 --- a/packages/camera/camera_windows/pubspec.yaml +++ b/packages/camera/camera_windows/pubspec.yaml @@ -2,7 +2,7 @@ name: camera_windows description: A Flutter plugin for getting information about and controlling the camera on Windows. repository: https://github.com/flutter/packages/tree/main/packages/camera/camera_windows issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22 -version: 0.2.6+1 +version: 0.2.6+2 environment: sdk: ^3.4.0 diff --git a/packages/camera/camera_windows/windows/capture_device_info.h b/packages/camera/camera_windows/windows/capture_device_info.h index 63ffa857109..b858b4f9839 100644 --- a/packages/camera/camera_windows/windows/capture_device_info.h +++ b/packages/camera/camera_windows/windows/capture_device_info.h @@ -25,8 +25,7 @@ class CaptureDeviceInfo { // Parses display name and device id from unique device name format. // Format: "display_name ". - bool CaptureDeviceInfo::ParseDeviceInfoFromCameraName( - const std::string& camera_name); + bool ParseDeviceInfoFromCameraName(const std::string& camera_name); // Updates display name. void SetDisplayName(const std::string& display_name) { diff --git a/packages/file_selector/file_selector_windows/CHANGELOG.md b/packages/file_selector/file_selector_windows/CHANGELOG.md index a895174e5e8..204ece58913 100644 --- a/packages/file_selector/file_selector_windows/CHANGELOG.md +++ b/packages/file_selector/file_selector_windows/CHANGELOG.md @@ -1,5 +1,6 @@ -## NEXT +## 0.9.3+4 +* Fixes compile errors under strict standards mode. * Updates minimum supported SDK version to Flutter 3.22/Dart 3.4. ## 0.9.3+3 diff --git a/packages/file_selector/file_selector_windows/example/windows/CMakeLists.txt b/packages/file_selector/file_selector_windows/example/windows/CMakeLists.txt index 57d4c0c59d3..4691cd75518 100644 --- a/packages/file_selector/file_selector_windows/example/windows/CMakeLists.txt +++ b/packages/file_selector/file_selector_windows/example/windows/CMakeLists.txt @@ -34,6 +34,9 @@ function(APPLY_STANDARD_SETTINGS TARGET) target_compile_features(${TARGET} PUBLIC cxx_std_17) target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") target_compile_options(${TARGET} PRIVATE /EHsc) + # Enable strict standards mode in the example app, since issues it finds + # may become errors by default in future compiler versions. + target_compile_options(${TARGET} PRIVATE /permissive-) target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") endfunction() diff --git a/packages/file_selector/file_selector_windows/pubspec.yaml b/packages/file_selector/file_selector_windows/pubspec.yaml index 4508b9d7cb1..e750dfa36f8 100644 --- a/packages/file_selector/file_selector_windows/pubspec.yaml +++ b/packages/file_selector/file_selector_windows/pubspec.yaml @@ -2,7 +2,7 @@ name: file_selector_windows description: Windows implementation of the file_selector plugin. repository: https://github.com/flutter/packages/tree/main/packages/file_selector/file_selector_windows issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+file_selector%22 -version: 0.9.3+3 +version: 0.9.3+4 environment: sdk: ^3.4.0 diff --git a/packages/file_selector/file_selector_windows/windows/file_selector_plugin.cpp b/packages/file_selector/file_selector_windows/windows/file_selector_plugin.cpp index 35697983108..3a43bd15e81 100644 --- a/packages/file_selector/file_selector_windows/windows/file_selector_plugin.cpp +++ b/packages/file_selector/file_selector_windows/windows/file_selector_plugin.cpp @@ -221,8 +221,9 @@ ErrorOr ShowDialog( mode == DialogMode::save ? CLSID_FileSaveDialog : CLSID_FileOpenDialog; DialogWrapper dialog(dialog_factory, dialog_type); if (!SUCCEEDED(dialog.last_result())) { - return FlutterError("System error", "Could not create dialog", - EncodableValue(dialog.last_result())); + return FlutterError( + "System error", "Could not create dialog", + EncodableValue(std::in_place_type, dialog.last_result())); } FILEOPENDIALOGOPTIONS dialog_options = 0; @@ -253,8 +254,9 @@ ErrorOr ShowDialog( std::optional result = dialog.Show(parent_window); if (!result) { if (dialog.last_result() != HRESULT_FROM_WIN32(ERROR_CANCELLED)) { - return FlutterError("System error", "Could not show dialog", - EncodableValue(dialog.last_result())); + return FlutterError( + "System error", "Could not show dialog", + EncodableValue(std::in_place_type, dialog.last_result())); } else { return FileDialogResult(EncodableList(), nullptr); } diff --git a/packages/local_auth/local_auth_windows/example/windows/CMakeLists.txt b/packages/local_auth/local_auth_windows/example/windows/CMakeLists.txt index 2163be881bd..9dcfdde4a07 100644 --- a/packages/local_auth/local_auth_windows/example/windows/CMakeLists.txt +++ b/packages/local_auth/local_auth_windows/example/windows/CMakeLists.txt @@ -34,6 +34,9 @@ function(APPLY_STANDARD_SETTINGS TARGET) target_compile_features(${TARGET} PUBLIC cxx_std_17) target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") target_compile_options(${TARGET} PRIVATE /EHsc) + # Enable strict standards mode in the example app, since issues it finds + # may become errors by default in future compiler versions. + target_compile_options(${TARGET} PRIVATE /permissive-) target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") endfunction() diff --git a/packages/path_provider/path_provider_windows/example/windows/CMakeLists.txt b/packages/path_provider/path_provider_windows/example/windows/CMakeLists.txt index abf90408efb..62856e3e0e1 100644 --- a/packages/path_provider/path_provider_windows/example/windows/CMakeLists.txt +++ b/packages/path_provider/path_provider_windows/example/windows/CMakeLists.txt @@ -34,6 +34,9 @@ function(APPLY_STANDARD_SETTINGS TARGET) target_compile_features(${TARGET} PUBLIC cxx_std_17) target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") target_compile_options(${TARGET} PRIVATE /EHsc) + # Enable strict standards mode in the example app, since issues it finds + # may become errors by default in future compiler versions. + target_compile_options(${TARGET} PRIVATE /permissive-) target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") endfunction() diff --git a/packages/pigeon/platform_tests/test_plugin/example/windows/CMakeLists.txt b/packages/pigeon/platform_tests/test_plugin/example/windows/CMakeLists.txt index 2324be7b66a..2d948d25a22 100644 --- a/packages/pigeon/platform_tests/test_plugin/example/windows/CMakeLists.txt +++ b/packages/pigeon/platform_tests/test_plugin/example/windows/CMakeLists.txt @@ -41,6 +41,9 @@ function(APPLY_STANDARD_SETTINGS TARGET) target_compile_features(${TARGET} PUBLIC cxx_std_17) target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") target_compile_options(${TARGET} PRIVATE /EHsc) + # Enable strict standards mode in the example app, since issues it finds + # may become errors by default in future compiler versions. + target_compile_options(${TARGET} PRIVATE /permissive-) target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") endfunction() diff --git a/packages/pigeon/platform_tests/test_plugin/windows/test_plugin.cpp b/packages/pigeon/platform_tests/test_plugin/windows/test_plugin.cpp index c6f69c0a8c0..209c623ef8c 100644 --- a/packages/pigeon/platform_tests/test_plugin/windows/test_plugin.cpp +++ b/packages/pigeon/platform_tests/test_plugin/windows/test_plugin.cpp @@ -90,18 +90,18 @@ ErrorOr TestPlugin::EchoAllTypes(const AllTypes& everything) { ErrorOr> TestPlugin::EchoAllNullableTypes( const AllNullableTypes* everything) { if (!everything) { - return std::nullopt; + return std::optional(std::nullopt); } - return *everything; + return std::optional(*everything); } ErrorOr> TestPlugin::EchoAllNullableTypesWithoutRecursion( const AllNullableTypesWithoutRecursion* everything) { if (!everything) { - return std::nullopt; + return std::optional(std::nullopt); } - return *everything; + return std::optional(*everything); } ErrorOr> TestPlugin::ThrowError() { @@ -288,193 +288,193 @@ TestPlugin::SendMultipleNullableTypesWithoutRecursion( ErrorOr> TestPlugin::EchoNullableInt( const int64_t* a_nullable_int) { if (!a_nullable_int) { - return std::nullopt; + return std::optional(std::nullopt); } - return *a_nullable_int; + return std::optional(*a_nullable_int); }; ErrorOr> TestPlugin::EchoNullableDouble( const double* a_nullable_double) { if (!a_nullable_double) { - return std::nullopt; + return std::optional(std::nullopt); } - return *a_nullable_double; + return std::optional(*a_nullable_double); }; ErrorOr> TestPlugin::EchoNullableBool( const bool* a_nullable_bool) { if (!a_nullable_bool) { - return std::nullopt; + return std::optional(std::nullopt); } - return *a_nullable_bool; + return std::optional(*a_nullable_bool); }; ErrorOr> TestPlugin::EchoNullableString( const std::string* a_nullable_string) { if (!a_nullable_string) { - return std::nullopt; + return std::optional(std::nullopt); } - return *a_nullable_string; + return std::optional(*a_nullable_string); }; ErrorOr>> TestPlugin::EchoNullableUint8List( const std::vector* a_nullable_uint8_list) { if (!a_nullable_uint8_list) { - return std::nullopt; + return std::optional>(std::nullopt); } - return *a_nullable_uint8_list; + return std::optional>(*a_nullable_uint8_list); }; ErrorOr> TestPlugin::EchoNullableObject( const EncodableValue* a_nullable_object) { if (!a_nullable_object) { - return std::nullopt; + return std::optional(std::nullopt); } - return *a_nullable_object; + return std::optional(*a_nullable_object); }; ErrorOr> TestPlugin::EchoNullableList( const EncodableList* a_nullable_list) { if (!a_nullable_list) { - return std::nullopt; + return std::optional(std::nullopt); } - return *a_nullable_list; + return std::optional(*a_nullable_list); }; ErrorOr> TestPlugin::EchoNullableEnumList( const EncodableList* enum_list) { if (!enum_list) { - return std::nullopt; + return std::optional(std::nullopt); } - return *enum_list; + return std::optional(*enum_list); }; ErrorOr> TestPlugin::EchoNullableClassList( const EncodableList* class_list) { if (!class_list) { - return std::nullopt; + return std::optional(std::nullopt); } - return *class_list; + return std::optional(*class_list); }; ErrorOr> TestPlugin::EchoNullableNonNullEnumList( const EncodableList* enum_list) { if (!enum_list) { - return std::nullopt; + return std::optional(std::nullopt); } - return *enum_list; + return std::optional(*enum_list); }; ErrorOr> TestPlugin::EchoNullableNonNullClassList( const EncodableList* class_list) { if (!class_list) { - return std::nullopt; + return std::optional(std::nullopt); } - return *class_list; + return std::optional(*class_list); }; ErrorOr> TestPlugin::EchoNullableMap( const EncodableMap* map) { if (!map) { - return std::nullopt; + return std::optional(std::nullopt); } - return *map; + return std::optional(*map); }; ErrorOr> TestPlugin::EchoNullableStringMap( const EncodableMap* string_map) { if (!string_map) { - return std::nullopt; + return std::optional(std::nullopt); } - return *string_map; + return std::optional(*string_map); }; ErrorOr> TestPlugin::EchoNullableIntMap( const EncodableMap* int_map) { if (!int_map) { - return std::nullopt; + return std::optional(std::nullopt); } - return *int_map; + return std::optional(*int_map); }; ErrorOr> TestPlugin::EchoNullableEnumMap( const EncodableMap* enum_map) { if (!enum_map) { - return std::nullopt; + return std::optional(std::nullopt); } - return *enum_map; + return std::optional(*enum_map); }; ErrorOr> TestPlugin::EchoNullableClassMap( const EncodableMap* class_map) { if (!class_map) { - return std::nullopt; + return std::optional(std::nullopt); } - return *class_map; + return std::optional(*class_map); }; ErrorOr> TestPlugin::EchoNullableNonNullStringMap( const EncodableMap* string_map) { if (!string_map) { - return std::nullopt; + return std::optional(std::nullopt); } - return *string_map; + return std::optional(*string_map); }; ErrorOr> TestPlugin::EchoNullableNonNullIntMap( const EncodableMap* int_map) { if (!int_map) { - return std::nullopt; + return std::optional(std::nullopt); } - return *int_map; + return std::optional(*int_map); }; ErrorOr> TestPlugin::EchoNullableNonNullEnumMap( const EncodableMap* enum_map) { if (!enum_map) { - return std::nullopt; + return std::optional(std::nullopt); } - return *enum_map; + return std::optional(*enum_map); }; ErrorOr> TestPlugin::EchoNullableNonNullClassMap( const EncodableMap* class_map) { if (!class_map) { - return std::nullopt; + return std::optional(std::nullopt); } - return *class_map; + return std::optional(*class_map); }; ErrorOr> TestPlugin::EchoNullableEnum( const AnEnum* an_enum) { if (!an_enum) { - return std::nullopt; + return std::optional(std::nullopt); } - return *an_enum; + return std::optional(*an_enum); } ErrorOr> TestPlugin::EchoAnotherNullableEnum( const AnotherEnum* another_enum) { if (!another_enum) { - return std::nullopt; + return std::optional(std::nullopt); } - return *another_enum; + return std::optional(*another_enum); } ErrorOr> TestPlugin::EchoOptionalNullableInt( const int64_t* a_nullable_int) { if (!a_nullable_int) { - return std::nullopt; + return std::optional(std::nullopt); } - return *a_nullable_int; + return std::optional(*a_nullable_int); } ErrorOr> TestPlugin::EchoNamedNullableString( const std::string* a_nullable_string) { if (!a_nullable_string) { - return std::nullopt; + return std::optional(std::nullopt); } - return *a_nullable_string; + return std::optional(*a_nullable_string); } void TestPlugin::NoopAsync( diff --git a/packages/url_launcher/url_launcher_windows/example/windows/CMakeLists.txt b/packages/url_launcher/url_launcher_windows/example/windows/CMakeLists.txt index 5a5d2e8034b..f0a6bda477e 100644 --- a/packages/url_launcher/url_launcher_windows/example/windows/CMakeLists.txt +++ b/packages/url_launcher/url_launcher_windows/example/windows/CMakeLists.txt @@ -34,6 +34,9 @@ function(APPLY_STANDARD_SETTINGS TARGET) target_compile_features(${TARGET} PUBLIC cxx_std_17) target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") target_compile_options(${TARGET} PRIVATE /EHsc) + # Enable strict standards mode in the example app, since issues it finds + # may become errors by default in future compiler versions. + target_compile_options(${TARGET} PRIVATE /permissive-) target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") endfunction()