Deprecate YGConfigSetUseLegacyStretchBehaviour (#37117)
Summary: X-link: https://github.com/facebook/react-native/pull/37117 Pull Request resolved: https://github.com/facebook/yoga/pull/1265 This deprecates `YGConfigSetUseLegacyStretchBehaviour` and `YGConfigGetUseLegacyStretchBehaviour`and points users to errata APIs instead. Using the C API will fire deprecation warnings, which should create errors in builds with `-Werror`, though they can be ignored if truly needed (like we do with the language bindings which need to expose their own deprecated interface). Reviewed By: rshest Differential Revision: D45337198 fbshipit-source-id: 7f069623e38834171f5702382bbf47c37a556a22
This commit is contained in:
committed by
Facebook GitHub Bot
parent
893b3e3957
commit
f32d37a3d5
@@ -19,6 +19,14 @@
|
||||
#define YG_EXTERN_C_END
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#define YG_DEPRECATED(message) [[deprecated(message)]]
|
||||
#elif defined(_MSC_VER)
|
||||
#define YG_DEPRECATED(message) __declspec(depreacted(message))
|
||||
#else
|
||||
#define YG_DEPRECATED(message) __attribute__((deprecated(message)))
|
||||
#endif
|
||||
|
||||
#ifdef _WINDLL
|
||||
#define WIN_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
|
15
yoga/Yoga.h
15
yoga/Yoga.h
@@ -323,8 +323,19 @@ WIN_EXPORT void YGConfigSetPointScaleFactor(
|
||||
// resulted in implicit behaviour similar to align-self: stretch; Because this
|
||||
// was such a long-standing bug we must allow legacy users to switch back to
|
||||
// this behaviour.
|
||||
WIN_EXPORT bool YGConfigGetUseLegacyStretchBehaviour(YGConfigRef config);
|
||||
WIN_EXPORT void YGConfigSetUseLegacyStretchBehaviour(
|
||||
WIN_EXPORT YG_DEPRECATED(
|
||||
"Please use "
|
||||
"\"YGConfigGetErrata()\"") bool YGConfigGetUseLegacyStretchBehaviour(YGConfigRef
|
||||
config);
|
||||
WIN_EXPORT
|
||||
YG_DEPRECATED(
|
||||
"\"YGConfigSetUseLegacyStretchBehaviour\" will be removed in the next "
|
||||
"release. Usage should be replaced with \"YGConfigSetErrata(YGErrataAll)\" "
|
||||
"to opt out of all future breaking conformance fixes, or "
|
||||
"\"YGConfigSetErrata(YGErrataStretchFlexBasis)\" to opt out of the "
|
||||
"specific conformance fix previously disabled by "
|
||||
"\"UseLegacyStretchBehaviour\".")
|
||||
void YGConfigSetUseLegacyStretchBehaviour(
|
||||
YGConfigRef config,
|
||||
bool useLegacyStretchBehaviour);
|
||||
|
||||
|
Reference in New Issue
Block a user