Skip to content

Commit c3fe98f

Browse files
authored
fix(windows): workaround for building with VS 2022 (#786)
1 parent 5b64b67 commit c3fe98f

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

windows/test-app.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,22 @@ function generateSolution(destPath, { autolink, useHermes, useNuGet }) {
711711
}
712712
);
713713

714+
// TODO: Remove when we drop support for 0.67.
715+
// Patch building with Visual Studio 2022. For more details, see
716+
// https://github.com/microsoft/react-native-windows/issues/9559
717+
if (rnWindowsVersionNumber < 6800) {
718+
const dispatchQueue = path.join(
719+
rnWindowsPath,
720+
"Mso",
721+
"dispatchQueue",
722+
"dispatchQueue.h"
723+
);
724+
copyAndReplace(dispatchQueue, dispatchQueue, {
725+
"template <typename T>\\s*inline void MustBeNoExceptVoidFunctor\\(\\) {\\s*static_assert\\(false":
726+
"namespace details {\n template <typename>\n constexpr bool always_false = false;\n}\n\ntemplate <typename T>\ninline void MustBeNoExceptVoidFunctor() {\n static_assert(details::always_false<T>",
727+
});
728+
}
729+
714730
if (useNuGet) {
715731
const nugetConfigPath =
716732
findNearest(

0 commit comments

Comments
 (0)