Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2022-03-14 18:54:46 +0300
committerJulian Eisel <julian@blender.org>2022-03-14 19:08:46 +0300
commita5578351c38e2b2bb45d940a2fc57354e5fe3a5e (patch)
tree3d6b5d275f27f6b549772586c2e3af59ea728a1d /source/blender/makesrna/intern/makesrna.c
parentcc98b40f870c39a997cf99412b308b8a0e82ed44 (diff)
Auto-generate RNA-structs declarations in `RNA_prototypes.h`
So far it was needed to declare a new RNA struct to `RNA_access.h` manually. Since 9b298cf3dbec we generate a `RNA_prototypes.h` for RNA property declarations. Now this also includes the RNA struct declarations, so they don't have to be added manually anymore. Differential Revision: https://developer.blender.org/D13862 Reviewed by: brecht, campbellbarton
Diffstat (limited to 'source/blender/makesrna/intern/makesrna.c')
-rw-r--r--source/blender/makesrna/intern/makesrna.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c
index f19bab6870a..c3ca57b38bf 100644
--- a/source/blender/makesrna/intern/makesrna.c
+++ b/source/blender/makesrna/intern/makesrna.c
@@ -3304,12 +3304,12 @@ static const char *rna_property_subtype_unit(PropertySubType type)
}
}
-static void rna_generate_internal_struct_prototypes(BlenderRNA *brna, FILE *f)
+static void rna_generate_struct_rna_prototypes(BlenderRNA *brna, FILE *f)
{
StructRNA *srna;
for (srna = brna->structs.first; srna; srna = srna->cont.next) {
- fprintf(f, "extern StructRNA RNA_%s;\n", srna->identifier);
+ fprintf(f, "extern struct StructRNA RNA_%s;\n", srna->identifier);
}
fprintf(f, "\n");
}
@@ -3345,6 +3345,8 @@ static void rna_generate_blender(BlenderRNA *brna, FILE *f)
static void rna_generate_external_property_prototypes(BlenderRNA *brna, FILE *f)
{
+ rna_generate_struct_rna_prototypes(brna, f);
+
for (StructRNA *srna = brna->structs.first; srna; srna = srna->cont.next) {
for (PropertyRNA *prop = srna->cont.properties.first; prop; prop = prop->next) {
fprintf(f, "extern struct PropertyRNA rna_%s_%s;\n", srna->identifier, prop->identifier);
@@ -5225,7 +5227,7 @@ static int rna_preprocess(const char *outfile, const char *public_header_outfile
fprintf(file,
"/* Automatically generated function declarations for the Data API.\n"
" * Do not edit manually, changes will be overwritten. */\n\n");
- rna_generate_internal_struct_prototypes(brna, file);
+ rna_generate_struct_rna_prototypes(brna, file);
fclose(file);
status = (DefRNA.error != 0);
}