From c5364414f2c02cc3cf4d4c1081d0e27096abcb44 Mon Sep 17 00:00:00 2001 From: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Date: Sun, 27 Feb 2022 22:26:03 +0100 Subject: [PATCH] fix(windows): workaround for building with VS 2022 --- windows/test-app.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/windows/test-app.js b/windows/test-app.js index b98f4da43..428c61523 100755 --- a/windows/test-app.js +++ b/windows/test-app.js @@ -711,6 +711,22 @@ function generateSolution(destPath, { autolink, useHermes, useNuGet }) { } ); + // TODO: Remove when we drop support for 0.67. + // Patch building with Visual Studio 2022. For more details, see + // https://github.com/microsoft/react-native-windows/issues/9559 + if (rnWindowsVersionNumber < 6800) { + const dispatchQueue = path.join( + rnWindowsPath, + "Mso", + "dispatchQueue", + "dispatchQueue.h" + ); + copyAndReplace(dispatchQueue, dispatchQueue, { + "template \\s*inline void MustBeNoExceptVoidFunctor\\(\\) {\\s*static_assert\\(false": + "namespace details {\n template \n constexpr bool always_false = false;\n}\n\ntemplate \ninline void MustBeNoExceptVoidFunctor() {\n static_assert(details::always_false", + }); + } + if (useNuGet) { const nugetConfigPath = findNearest(