Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Macro Errors for Windows #34299

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ReactCommon/react/renderer/components/text/BaseTextProps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down
6 changes: 3 additions & 3 deletions ReactCommon/react/renderer/components/view/ViewProps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,13 +261,13 @@ ViewProps::ViewProps(
#define VIEW_EVENT_CASE(eventType, eventString) \
case CONSTEXPR_RAW_PROPS_KEY_HASH(eventString): { \
ViewEvents defaultViewEvents{}; \
events[eventType] = ({ \
events[eventType] = [defaultViewEvents, &value, &context]{ \
bool res = defaultViewEvents[eventType]; \
if (value.hasValue()) { \
fromRawValue(context, value, res); \
} \
res; \
}); \
return res; \
}(); \
return; \
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class ConcreteComponentDescriptor : public ComponentDescriptor {
rawProps.iterateOverValues([&](RawPropsPropNameHash hash,
const char *propName,
RawValue const &fn) {
shadowNodeProps.get()->setProp(context, hash, propName, fn);
shadowNodeProps.get()->Props::setProp(context, hash, propName, fn);
});
}

Expand Down
8 changes: 3 additions & 5 deletions ReactCommon/react/renderer/core/PropsMacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,12 @@

// Get hash at compile-time. sizeof(str) - 1 == strlen
#define CONSTEXPR_RAW_PROPS_KEY_HASH(s) \
({ \
[]{ \
CLANG_PRAGMA("clang diagnostic push") \
CLANG_PRAGMA("clang diagnostic ignored \"-Wshadow\"") \
constexpr RawPropsPropNameHash propNameHash = \
folly::hash::fnv32_buf(s, sizeof(s) - 1); \
propNameHash; \
return folly::hash::fnv32_buf(s, sizeof(s) - 1); \
CLANG_PRAGMA("clang diagnostic pop") \
})
}()

#define RAW_PROPS_KEY_HASH(s) folly::hash::fnv32_buf(s, std::strlen(s))

Expand Down