Files
test/source
Bastien Montagne e25756cb62 RNA: Fix illegal types mismatch in extern'ed PropertyRNA data.
Previous code would declare properties as `extern PropertyRNA`, but
implement them as type-refined data (e.g. `FloatPropertyRNA`).

This is fully illegal thing, it happened to work 'fine' so far for two
main reasons:
* C-linking does not do type-checks on extern data.
* Code using these publicly exposed data would always use them as
  `PorpertyRNA *` pointers, and pass them to RNA API.

However, this (finally !) breaks when trying to move generated
`RNA_property.h` header to C++, since at least MSVC2022 does mangle the
type in the extern'ed symbol name, which makes linking fails epically.

This commit fixes the issue by only declaring `PointerRNA *` pointers in
the headers. These pointers are then defined in each implementation file
(the `rna_xxx_gen.cc` ones), and assinged to the address of a matching
local static variable. These static variables are type-refined, and
actually contain the property definition data.

Pull Request: https://projects.blender.org/blender/blender/pulls/124603
2024-07-15 11:34:27 +02:00
..