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>2020-11-19 15:41:50 +0300
committerJulian Eisel <julian@blender.org>2020-11-19 15:41:50 +0300
commitad4b7741dba45a2be210942c18af6b6e4438f129 (patch)
treead7682ae65022145ab16c173f8ff7062df7a0192 /source/blender/makesdna/DNA_particle_types.h
parent1395ba70bf37bc0a21920416b0abbaac9af2b7e5 (diff)
Build-system: Force C linkage for all DNA type headers
Some DNA headers already did this, most did not. Even though many of them would be included in C++ files and thus compiled as C++. This would be confusing and developers may think they have to add `extern "C"` too a whole lot of (indirect) includes to be able to use a C header in C++. However, this is a misconception. `extern "C"` does not cause code to be compiled with C rather than C++! It only causes the linker to not use C++ function name mangling. See https://stackoverflow.com/a/1041880. Because extern DNA headers don't have function declarations, using `extern "C"` actually should not have any effect. On the other hand, adding it causes no harm and avoids confusion. So let's just have it consistently in C header files. Differential Revision: https://developer.blender.org/D9578 Reviewed by: Bastien Montagne, Sybren Stüvel
Diffstat (limited to 'source/blender/makesdna/DNA_particle_types.h')
-rw-r--r--source/blender/makesdna/DNA_particle_types.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/makesdna/DNA_particle_types.h b/source/blender/makesdna/DNA_particle_types.h
index bd19498eba7..d48144f90e8 100644
--- a/source/blender/makesdna/DNA_particle_types.h
+++ b/source/blender/makesdna/DNA_particle_types.h
@@ -27,6 +27,10 @@
#include "DNA_boid_types.h"
#include "DNA_defs.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct AnimData;
typedef struct HairKey {
@@ -690,3 +694,7 @@ typedef enum eParticleTextureInfluence {
PAMAP_CHILD = (PAMAP_CLUMP | PAMAP_KINK_FREQ | PAMAP_KINK_AMP | PAMAP_ROUGH | PAMAP_LENGTH |
PAMAP_TWIST),
} eParticleTextureInfluence;
+
+#ifdef __cplusplus
+}
+#endif