From ad4b7741dba45a2be210942c18af6b6e4438f129 Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Thu, 19 Nov 2020 13:41:50 +0100 Subject: Build-system: Force C linkage for all DNA type headers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- source/blender/makesdna/DNA_speaker_types.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/blender/makesdna/DNA_speaker_types.h') diff --git a/source/blender/makesdna/DNA_speaker_types.h b/source/blender/makesdna/DNA_speaker_types.h index 82693689d68..29cccd1ef3a 100644 --- a/source/blender/makesdna/DNA_speaker_types.h +++ b/source/blender/makesdna/DNA_speaker_types.h @@ -22,6 +22,10 @@ #include "DNA_ID.h" +#ifdef __cplusplus +extern "C" { +#endif + struct AnimData; struct bSound; @@ -57,3 +61,7 @@ typedef struct Speaker { #define SPK_DS_EXPAND (1 << 0) #define SPK_MUTED (1 << 1) // #define SPK_RELATIVE (1 << 2) /* UNUSED */ + +#ifdef __cplusplus +} +#endif -- cgit v1.2.3