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_ipo_types.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/blender/makesdna/DNA_ipo_types.h') diff --git a/source/blender/makesdna/DNA_ipo_types.h b/source/blender/makesdna/DNA_ipo_types.h index dfd06702b72..8bb94976414 100644 --- a/source/blender/makesdna/DNA_ipo_types.h +++ b/source/blender/makesdna/DNA_ipo_types.h @@ -36,6 +36,10 @@ #include "BLI_compiler_attrs.h" +#ifdef __cplusplus +extern "C" { +#endif + /* -------------------------- Type Defines --------------------------- */ /* --- IPO Curve Driver --- */ @@ -516,3 +520,7 @@ typedef struct Ipo { /* driver->flag */ /* invalid flag: currently only used for buggy pydriver expressions */ #define IPO_DRIVER_FLAG_INVALID (1 << 0) + +#ifdef __cplusplus +} +#endif -- cgit v1.2.3