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_curveprofile_types.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/blender/makesdna/DNA_curveprofile_types.h') diff --git a/source/blender/makesdna/DNA_curveprofile_types.h b/source/blender/makesdna/DNA_curveprofile_types.h index 5b425741df2..450155a32e1 100644 --- a/source/blender/makesdna/DNA_curveprofile_types.h +++ b/source/blender/makesdna/DNA_curveprofile_types.h @@ -25,6 +25,10 @@ #include "DNA_vec_types.h" +#ifdef __cplusplus +extern "C" { +#endif + /** Number of points in high resolution table is dynamic up to a maximum. */ #define PROF_TABLE_MAX 512 /** Number of table points per control point. */ @@ -98,3 +102,7 @@ typedef enum eCurveProfilePresets { PROF_PRESET_CROWN = 3, /* Second molding example. */ PROF_PRESET_STEPS = 4, /* Dynamic number of steps defined by segments_len. */ } eCurveProfilePresets; + +#ifdef __cplusplus +} +#endif -- cgit v1.2.3