[Bf-blender-cvs] [4fdd8452a6a] master: DNA: add pragma once to dna_type_offsets.h

Jacques Lucke noreply at git.blender.org
Fri Aug 28 15:07:06 CEST 2020


Commit: 4fdd8452a6a714ceddd4a2c5105f64b9ccf7e265
Author: Jacques Lucke
Date:   Fri Aug 28 15:04:45 2020 +0200
Branches: master
https://developer.blender.org/rB4fdd8452a6a714ceddd4a2c5105f64b9ccf7e265

DNA: add pragma once to dna_type_offsets.h

Sometimes, this generated file is included more than once,
so it should have an include guard.

===================================================================

M	source/blender/makesdna/intern/makesdna.c

===================================================================

diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c
index 7aaedbff1ce..29e29961028 100644
--- a/source/blender/makesdna/intern/makesdna.c
+++ b/source/blender/makesdna/intern/makesdna.c
@@ -1373,6 +1373,7 @@ static int make_structDNA(const char *base_directory,
   /* write a simple enum with all structs offsets,
    * should only be accessed via SDNA_TYPE_FROM_STRUCT macro */
   {
+    fprintf(file_offsets, "#pragma once\n");
     fprintf(file_offsets, "#define SDNA_TYPE_FROM_STRUCT(id) _SDNA_TYPE_##id\n");
     fprintf(file_offsets, "enum {\n");
     for (i = 0; i < structs_len; i++) {



More information about the Bf-blender-cvs mailing list