Skip to content

Commit 2f1e651

Browse files
authored
Update comments written by component_writers.h (#1043)
1 parent c07461f commit 2f1e651

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

cppwinrt/component_writers.h

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -988,9 +988,24 @@ namespace winrt::@::implementation
988988
static void write_generated_static_assert(writer& w)
989989
{
990990
auto format = R"(
991-
// Note: Remove this static_assert after copying these generated source files to your project.
992-
// This assertion exists to avoid compiling these generated source files directly.
993-
static_assert(false, "Do not compile generated C++/WinRT source files directly");
991+
// WARNING: This file is automatically generated by a tool. Do not directly
992+
// add this file to your project, as any changes you make will be lost.
993+
// This file is a stub you can use as a starting point for your implementation.
994+
//
995+
// To add a copy of this file to your project:
996+
// 1. Copy this file from its original location to the location where you store
997+
// your other source files (e.g. the project root).
998+
// 2. Add the copied file to your project. In Visual Studio, you can use
999+
// Project -> Add Existing Item.
1000+
// 3. Delete this comment and the 'static_assert' (below) from the copied file.
1001+
// Do not modify the original file.
1002+
//
1003+
// To update an existing file in your project:
1004+
// 1. Copy the relevant changes from this file and merge them into the copy
1005+
// you made previously.
1006+
//
1007+
// This assertion helps prevent accidental modification of generated files.
1008+
static_assert(false, "This file is generated by a tool and will be overwritten. Open this error and view the comment for assistance.");
9941009
)";
9951010

9961011
w.write(format);
@@ -1206,4 +1221,4 @@ namespace winrt::@::implementation
12061221
slot);
12071222
}
12081223
}
1209-
}
1224+
}

0 commit comments

Comments
 (0)