Fix Macro Errors for Windows (#34299)

Summary:
Fix macro errors for Windows. Current syntax breaks the build of the React Common project on Windows because the ({...}) syntax is not supported; must be replaced with lambda expressions.

Resolves https://github.com/facebook/react-native/issues/34090

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[General] [Fixed] - Fix macro errors for Windows.

lyahdav JoshuaGross

Pull Request resolved: https://github.com/facebook/react-native/pull/34299

Test Plan: Build on react-native-windows repo. Tested in RNW app.

Reviewed By: javache

Differential Revision: D38272966

Pulled By: NickGerleman

fbshipit-source-id: e76eac11cde173ef49465d01d793c593017f2ab7
This commit is contained in:
Chiara Mooney authored and Facebook GitHub Bot committed 2022-08-01 20:54:59 -07:00
1 parent cd595bd090
commit fc26dbfce0
4 files changed
+20 -21

No files matched your search

@@ -13,12 +13,12 @@
#include <react/renderer/graphics/conversions.h>
#define GET_FIELD_VALUE(field, fieldName, defaultValue, rawValue) \
(rawValue.hasValue() ? ({ \
(rawValue.hasValue() ? ([&rawValue, &context] { \
decltype(defaultValue) res; \
fromRawValue(context, rawValue, res); \
res; \
}) \
: defaultValue)
return res; \
}()) \
: defaultValue);
#define REBUILD_FIELD_SWITCH_CASE( \
defaults, rawValue, property, field, fieldName) \