[Bf-committers] RNA Forward Declarations Are Now Generated

Julian Eisel julian at blender.org
Mon Mar 14 17:25:02 CET 2022


Hi all,

Just a heads up on an RNA change that affects other developers. So far, when defining a new RNA struct, you'd usually also have to add a forward declaration of the generated struct to `RNA_access.h`, something like:

`extern StructRNA RNA_MyNewStruct;`

Makesrna now generates them at compile time, so this isn’t needed anymore. It also generates forward declarations for all RNA properties. We used to add these property declarations manually within functions in a bunch of places, which caused issues with C++ on MSVC.

To access the forward declared RNA structs or properties:  #include “RNA_prototypes.h”

Commits:
- https://developer.blender.org/rB9b298cf3dbec <https://developer.blender.org/rB9b298cf3dbec>
- https://developer.blender.org/rBa5578351c38e <https://developer.blender.org/rBa5578351c38e>

Cheers
- Julian Eisel -

———————————————————————————————————————————
Julian Eisel - julian at blender.org - www.blender.org
Software Developer
Buikslotermeerplein 161, 1025 ET Amsterdam, the Netherlands
———————————————————————————————————————————


More information about the Bf-committers mailing list