mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Ensure trailing newline before EOF in C++ sources (#11489)
In generated text fixture location lookup code: When the second argument to write_file() is a list, it is written one item per line to the path specified by the first argument. This ensures that we emit a trailing newline at EOF to comply with -Wnewline-eof. Elsewhere: Lack of a newline at EOF was undefined behaviour prior to C++11. The Fuchsia tree sets -Wnewline-eof in its buildroot, so we plan to do the same. This cleans up remaining first-party C++ sources that don't include a trailing newline.
This commit is contained in:
parent
1ed1ee7c2a
commit
92c63e848a
@ -23,4 +23,4 @@ using JsonValueType = rapidjson::Document;
|
||||
using JsonValueType = Json::Value;
|
||||
#endif
|
||||
|
||||
#endif // FLUTTER_SHELL_PLATFORM_COMMON_CPP_CLIENT_WRAPPER_INCLUDE_FLUTTER_JSON_TYPE_H_
|
||||
#endif // FLUTTER_SHELL_PLATFORM_COMMON_CPP_CLIENT_WRAPPER_INCLUDE_FLUTTER_JSON_TYPE_H_
|
||||
|
||||
@ -25,4 +25,4 @@
|
||||
|
||||
#endif // FLUTTER_DESKTOP_LIBRARY
|
||||
|
||||
#endif // FLUTTER_SHELL_PLATFORM_COMMON_CPP_PUBLIC_FLUTTER_EXPORT_H_
|
||||
#endif // FLUTTER_SHELL_PLATFORM_COMMON_CPP_PUBLIC_FLUTTER_EXPORT_H_
|
||||
|
||||
@ -35,4 +35,4 @@
|
||||
|
||||
@end
|
||||
|
||||
#endif // SHELL_PLATFORM_DARWIN_MACOS_FRAMEWORK_SOURCE_FLUTTERDARTPROJECT_INTERNAL_H_
|
||||
#endif // SHELL_PLATFORM_DARWIN_MACOS_FRAMEWORK_SOURCE_FLUTTERDARTPROJECT_INTERNAL_H_
|
||||
|
||||
@ -20,7 +20,10 @@ template("fixtures_location") {
|
||||
assert(defined(invoker.assets_dir), "The assets directory.")
|
||||
|
||||
location_path = rebase_path(invoker.assets_dir)
|
||||
location_source = "namespace flutter {namespace testing {const char* GetFixturesPath() {return \"$location_path\";}}}"
|
||||
|
||||
# Array of source lines. We use a list to ensure a trailing newline is
|
||||
# emitted by write_file() to comply with -Wnewline-eof.
|
||||
location_source = [ "namespace flutter {namespace testing {const char* GetFixturesPath() {return \"$location_path\";}}}" ]
|
||||
location_source_path = "$target_gen_dir/fixtures_location$target_name.cc"
|
||||
|
||||
write_file(location_source_path, location_source)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user