Skip to content

fix(unreal): use FProperty constructors without EObjectFlags on UE 5.8 - #2364

Merged
chexiongsheng merged 1 commit into
Tencent:masterfrom
heitara:fix/unreal5.8-fproperty-constructors
Sep 20, 2026
Merged

chexiongsheng merged 1 commit into
Tencent:masterfrom
heitara:fix/unreal5.8-fproperty-constructors

Conversation

@kbrizov

@kbrizov kbrizov commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

UE 5.8 deprecates the FField / FProperty constructors that take an EObjectFlags argument. Every property created in ContainerMeta.cpp used that overload, so building the JsEnv module on 5.8 produced 14 C4996 warnings with the note that the parameter must be removed before the next engine release. This PR switches those call sites to the two-argument constructor on 5.8 and later, and leaves earlier engines untouched.

Changes

ContainerMeta.cpp only:

  • A file-local macro PUERTS_NEW_PROPERTY(Type, Owner, Name) expands to new Type(Owner, Name) when ENGINE_MAJOR_VERSION > 5 || (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 8), and to the existing new Type(Owner, Name, RF_Transient) otherwise. It is #undef'd at the end of the file.
  • The 14 new F…Property(…, RF_Transient) expressions (bool, byte, int, float, double, int64, string, text, name, object, struct, enum, the enum's underlying byte property, and the byte-enum property) now go through the macro.
  • A comment explains why dropping RF_Transient on 5.8 is correct: 5.8 also deprecates FField::FlagsPrivate, which is superseded by FProperty::PropertyFlags, and this file already sets those via CPF_*.

No behaviour change is intended on any engine version.

Verification

Full Development editor builds from a clean Intermediate/ and Binaries/ on Windows, Epic Launcher engines, default V8 9.4.146.24, warning lists compared line by line against the unmodified plugin:

  • UE 5.8: build succeeds; the warning list goes from 55 to 41 unique lines. The 14 removed lines are exactly the ContainerMeta.cpp C4996 warnings. No warning was added.
  • UE 5.7: build succeeds; the warning list is identical to the unmodified plugin (53 lines).
  • Editor sessions on both versions load the plugin and run the declaration generator and a TypeScript Blueprint class through PIE without regression.

Notes for reviewers

  • The macro exists only to keep the version check in one place; each call site is otherwise a one-line change.
  • The change is independent of the reserved-word declaration fix submitted separately; the two apply cleanly in either order.

UE 5.8 deprecates the FField/FProperty constructors that take an
EObjectFlags argument (C4996, "remove that parameter ... otherwise your
project will no longer compile" on the next release). ContainerMeta.cpp
now selects the constructor through PUERTS_NEW_PROPERTY, gated on
ENGINE_MAJOR_VERSION > 5 || (ENGINE_MAJOR_VERSION == 5 &&
ENGINE_MINOR_VERSION >= 8), so the module compiles without deprecation
warnings on 5.8 and is unchanged on earlier engines.

@heitara heitara left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@kbrizov kbrizov mentioned this pull request Sep 10, 2026
kbrizov added a commit to kbrizov/puerts that referenced this pull request Sep 10, 2026
…nt#2365 Tencent#2366)

All fork-local changes on kbrizov master (ContainerMeta constructor gate, reserved-word
escaping, ProcessMulticastDelegate gate) are superseded by the merged PRs or by Tencent's
own fixes; conflicts resolved by taking heitara's version throughout. Resulting tree is
identical to heitara master.
@chexiongsheng
chexiongsheng merged commit 83aea66 into Tencent:master Sep 20, 2026
12 checks passed
@kbrizov
kbrizov deleted the fix/unreal5.8-fproperty-constructors branch September 21, 2026 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants