diff options
author | Jacques Lucke <jacques@blender.org> | 2020-05-08 19:16:39 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-05-08 19:22:41 +0300 |
commit | 6f985574b775882075f48f59835bc5a42b1374dd (patch) | |
tree | b68afdd1a5ef313ef13ad7d7ed46b6f6f92e8000 /source/blender/blenkernel | |
parent | 0d0dcfd64343930ba66e70c400cbd66f20a85b4f (diff) |
Cleanup: take includes out of 'extern "C"' blocks
Surrounding includes with an 'extern "C"' block is not necessary anymore.
Also that made it harder to add any C++ code to some headers, or include headers
that have "optional" C++ code like `MEM_guardedalloc.h`.
I tested compilation on linux and windows (and got help from @LazyDodo).
If this still breaks compilation due to some linker error, the header containing
the symbol in question is probably missing an 'extern "C"' block.
Differential Revision: https://developer.blender.org/D7653
Diffstat (limited to 'source/blender/blenkernel')
21 files changed, 55 insertions, 47 deletions
diff --git a/source/blender/blenkernel/BKE_action.h b/source/blender/blenkernel/BKE_action.h index 5f4f3f35b82..104582be932 100644 --- a/source/blender/blenkernel/BKE_action.h +++ b/source/blender/blenkernel/BKE_action.h @@ -25,12 +25,12 @@ * \brief Blender kernel action and pose functionality. */ +#include "DNA_listBase.h" + #ifdef __cplusplus extern "C" { #endif -#include "DNA_listBase.h" - /* The following structures are defined in DNA_action_types.h, and DNA_anim_types.h */ struct FCurve; struct Main; diff --git a/source/blender/blenkernel/BKE_anim_data.h b/source/blender/blenkernel/BKE_anim_data.h index 071254be783..8809fadd55c 100644 --- a/source/blender/blenkernel/BKE_anim_data.h +++ b/source/blender/blenkernel/BKE_anim_data.h @@ -24,12 +24,12 @@ * \ingroup bke */ +#include "BLI_sys_types.h" /* for bool */ + #ifdef __cplusplus extern "C" { #endif -#include "BLI_sys_types.h" /* for bool */ - struct AnimData; struct ID; struct Main; diff --git a/source/blender/blenkernel/BKE_animsys.h b/source/blender/blenkernel/BKE_animsys.h index 4076bca3b19..4a2ad28f90f 100644 --- a/source/blender/blenkernel/BKE_animsys.h +++ b/source/blender/blenkernel/BKE_animsys.h @@ -24,12 +24,12 @@ * \ingroup bke */ +#include "BLI_sys_types.h" /* for bool */ + #ifdef __cplusplus extern "C" { #endif -#include "BLI_sys_types.h" /* for bool */ - struct AnimData; struct Depsgraph; struct FCurve; diff --git a/source/blender/blenkernel/BKE_armature.h b/source/blender/blenkernel/BKE_armature.h index e59d5728350..5238853a105 100644 --- a/source/blender/blenkernel/BKE_armature.h +++ b/source/blender/blenkernel/BKE_armature.h @@ -22,13 +22,12 @@ /** \file * \ingroup bke */ +#include "BLI_listbase.h" #ifdef __cplusplus extern "C" { #endif -#include "BLI_listbase.h" - struct Bone; struct Depsgraph; struct ListBase; diff --git a/source/blender/blenkernel/BKE_blender_version.h b/source/blender/blenkernel/BKE_blender_version.h index bc64f78ffae..4b917beee17 100644 --- a/source/blender/blenkernel/BKE_blender_version.h +++ b/source/blender/blenkernel/BKE_blender_version.h @@ -16,6 +16,10 @@ #ifndef __BKE_BLENDER_VERSION_H__ #define __BKE_BLENDER_VERSION_H__ +#ifdef __cplusplus +extern "C" { +#endif + /** \file * \ingroup bke */ @@ -43,4 +47,8 @@ /** Defined in from blender.c */ extern char versionstr[]; +#ifdef __cplusplus +} +#endif + #endif /* __BKE_BLENDER_VERSION_H__ */ diff --git a/source/blender/blenkernel/BKE_context.h b/source/blender/blenkernel/BKE_context.h index c4fb19ea355..70ca29d5795 100644 --- a/source/blender/blenkernel/BKE_context.h +++ b/source/blender/blenkernel/BKE_context.h @@ -25,6 +25,7 @@ */ #include "DNA_listBase.h" +#include "DNA_object_enums.h" #include "RNA_types.h" #ifdef __cplusplus @@ -66,8 +67,6 @@ struct bScreen; struct wmWindow; struct wmWindowManager; -#include "DNA_object_enums.h" - /* Structs */ struct bContext; diff --git a/source/blender/blenkernel/BKE_curve.h b/source/blender/blenkernel/BKE_curve.h index 3524be99d0a..2b17cb7a875 100644 --- a/source/blender/blenkernel/BKE_curve.h +++ b/source/blender/blenkernel/BKE_curve.h @@ -23,12 +23,12 @@ * \ingroup bke */ +#include "DNA_scene_types.h" + #ifdef __cplusplus extern "C" { #endif -#include "DNA_scene_types.h" - struct BezTriple; struct Curve; struct Depsgraph; diff --git a/source/blender/blenkernel/BKE_customdata.h b/source/blender/blenkernel/BKE_customdata.h index a4a36343ca3..1a919a33034 100644 --- a/source/blender/blenkernel/BKE_customdata.h +++ b/source/blender/blenkernel/BKE_customdata.h @@ -25,15 +25,15 @@ #ifndef __BKE_CUSTOMDATA_H__ #define __BKE_CUSTOMDATA_H__ -#ifdef __cplusplus -extern "C" { -#endif - #include "BLI_sys_types.h" #include "BLI_utildefines.h" #include "DNA_customdata_types.h" +#ifdef __cplusplus +extern "C" { +#endif + struct BMesh; struct CustomData; struct CustomData_MeshMasks; diff --git a/source/blender/blenkernel/BKE_data_transfer.h b/source/blender/blenkernel/BKE_data_transfer.h index 79ef512bc1f..463c672ca47 100644 --- a/source/blender/blenkernel/BKE_data_transfer.h +++ b/source/blender/blenkernel/BKE_data_transfer.h @@ -24,12 +24,12 @@ #ifndef __BKE_DATA_TRANSFER_H__ #define __BKE_DATA_TRANSFER_H__ +#include "BKE_customdata.h" + #ifdef __cplusplus extern "C" { #endif -#include "BKE_customdata.h" - struct Depsgraph; struct Object; struct ReportList; diff --git a/source/blender/blenkernel/BKE_dynamicpaint.h b/source/blender/blenkernel/BKE_dynamicpaint.h index 0dc133e34b3..5e3603a8339 100644 --- a/source/blender/blenkernel/BKE_dynamicpaint.h +++ b/source/blender/blenkernel/BKE_dynamicpaint.h @@ -21,12 +21,12 @@ * \ingroup bke */ +#include "BLI_utildefines.h" + #ifdef __cplusplus extern "C" { #endif -#include "BLI_utildefines.h" - struct Depsgraph; struct DynamicPaintCanvasSettings; struct DynamicPaintModifierData; diff --git a/source/blender/blenkernel/BKE_fcurve.h b/source/blender/blenkernel/BKE_fcurve.h index e620beb6ccc..21a9b7b8b04 100644 --- a/source/blender/blenkernel/BKE_fcurve.h +++ b/source/blender/blenkernel/BKE_fcurve.h @@ -24,6 +24,8 @@ * \ingroup bke */ +#include "DNA_curve_types.h" + #ifdef __cplusplus extern "C" { #endif @@ -42,8 +44,6 @@ struct StructRNA; struct bAction; struct bContext; -#include "DNA_curve_types.h" - /* ************** Keyframe Tools ***************** */ typedef struct CfraElem { diff --git a/source/blender/blenkernel/BKE_fcurve_driver.h b/source/blender/blenkernel/BKE_fcurve_driver.h index ee531abfb72..563ed408ed7 100644 --- a/source/blender/blenkernel/BKE_fcurve_driver.h +++ b/source/blender/blenkernel/BKE_fcurve_driver.h @@ -24,6 +24,8 @@ * \ingroup bke */ +#include "DNA_curve_types.h" + #ifdef __cplusplus extern "C" { #endif @@ -36,8 +38,6 @@ struct PathResolvedRNA; struct PointerRNA; struct PropertyRNA; -#include "DNA_curve_types.h" - /* ************** F-Curve Drivers ***************** */ /* With these iterators for convenience, the variables "tarIndex" and "dtar" can be diff --git a/source/blender/blenkernel/BKE_image.h b/source/blender/blenkernel/BKE_image.h index 37082947687..1e5573ab014 100644 --- a/source/blender/blenkernel/BKE_image.h +++ b/source/blender/blenkernel/BKE_image.h @@ -23,12 +23,12 @@ * \ingroup bke */ +#include "BLI_utildefines.h" + #ifdef __cplusplus extern "C" { #endif -#include "BLI_utildefines.h" - struct Depsgraph; struct ID; struct ImBuf; diff --git a/source/blender/blenkernel/BKE_lib_id.h b/source/blender/blenkernel/BKE_lib_id.h index 0c91ba6231b..1f89edf905a 100644 --- a/source/blender/blenkernel/BKE_lib_id.h +++ b/source/blender/blenkernel/BKE_lib_id.h @@ -46,12 +46,12 @@ * specific cases requiring advanced (and potentially dangerous) handling. */ +#include "BLI_compiler_attrs.h" + #ifdef __cplusplus extern "C" { #endif -#include "BLI_compiler_attrs.h" - struct GHash; struct ID; struct Library; diff --git a/source/blender/blenkernel/BKE_lib_remap.h b/source/blender/blenkernel/BKE_lib_remap.h index 72c5f1d1b0e..8129b9dbafb 100644 --- a/source/blender/blenkernel/BKE_lib_remap.h +++ b/source/blender/blenkernel/BKE_lib_remap.h @@ -33,12 +33,12 @@ * - `BKE_lib_remap_callback_` should be used for functions managing remapping callbacks. */ +#include "BLI_compiler_attrs.h" + #ifdef __cplusplus extern "C" { #endif -#include "BLI_compiler_attrs.h" - struct wmWindowManager; /* BKE_libblock_free, delete are declared in BKE_lib_id.h for convenience. */ diff --git a/source/blender/blenkernel/BKE_library.h b/source/blender/blenkernel/BKE_library.h index 5bc3d50bf8d..7883d740b0a 100644 --- a/source/blender/blenkernel/BKE_library.h +++ b/source/blender/blenkernel/BKE_library.h @@ -25,12 +25,12 @@ * API to manage `Library` data-blocks. */ +#include "BLI_compiler_attrs.h" + #ifdef __cplusplus extern "C" { #endif -#include "BLI_compiler_attrs.h" - struct Library; struct Main; diff --git a/source/blender/blenkernel/BKE_light.h b/source/blender/blenkernel/BKE_light.h index a6f0fdbc8a3..17f7a8596bf 100644 --- a/source/blender/blenkernel/BKE_light.h +++ b/source/blender/blenkernel/BKE_light.h @@ -24,12 +24,13 @@ * \ingroup bke * \brief General operations, lookup, etc. for blender lights. */ + +#include "BLI_compiler_attrs.h" + #ifdef __cplusplus extern "C" { #endif -#include "BLI_compiler_attrs.h" - struct Light; struct Main; diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h index 70a44d6d8ce..3710ec810ce 100644 --- a/source/blender/blenkernel/BKE_object.h +++ b/source/blender/blenkernel/BKE_object.h @@ -21,12 +21,15 @@ * \ingroup bke * \brief General operations, lookup, etc. for blender objects. */ + +#include "BLI_compiler_attrs.h" + +#include "DNA_object_enums.h" + #ifdef __cplusplus extern "C" { #endif -#include "BLI_compiler_attrs.h" - struct Base; struct BoundBox; struct Depsgraph; @@ -46,8 +49,6 @@ struct ShaderFxData; struct View3D; struct ViewLayer; -#include "DNA_object_enums.h" - void BKE_object_workob_clear(struct Object *workob); void BKE_object_workob_calc_parent(struct Depsgraph *depsgraph, struct Scene *scene, diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h index 7822f285c3b..5c126ed08d4 100644 --- a/source/blender/blenkernel/BKE_paint.h +++ b/source/blender/blenkernel/BKE_paint.h @@ -24,6 +24,9 @@ * \ingroup bke */ +#include "BLI_utildefines.h" +#include "DNA_object_enums.h" + #ifdef __cplusplus extern "C" { #endif @@ -65,9 +68,6 @@ struct tPaletteColorHSV; enum eOverlayFlags; -#include "BLI_utildefines.h" -#include "DNA_object_enums.h" - extern const char PAINT_CURSOR_SCULPT[3]; extern const char PAINT_CURSOR_VERTEX_PAINT[3]; extern const char PAINT_CURSOR_WEIGHT_PAINT[3]; diff --git a/source/blender/blenkernel/BKE_report.h b/source/blender/blenkernel/BKE_report.h index d7ce9625548..063c0831a0d 100644 --- a/source/blender/blenkernel/BKE_report.h +++ b/source/blender/blenkernel/BKE_report.h @@ -21,16 +21,16 @@ * \ingroup bke */ -#ifdef __cplusplus -extern "C" { -#endif - #include <stdio.h> #include "BLI_compiler_attrs.h" #include "BLI_utildefines.h" #include "DNA_windowmanager_types.h" +#ifdef __cplusplus +extern "C" { +#endif + /* Reporting Information and Errors * * These functions also accept NULL in case no error reporting diff --git a/source/blender/blenkernel/BKE_text_suggestions.h b/source/blender/blenkernel/BKE_text_suggestions.h index dc908ee5232..d618fcd6d11 100644 --- a/source/blender/blenkernel/BKE_text_suggestions.h +++ b/source/blender/blenkernel/BKE_text_suggestions.h @@ -23,12 +23,12 @@ * \ingroup bke */ +#include "DNA_text_types.h" + #ifdef __cplusplus extern "C" { #endif -#include "DNA_text_types.h" - /* **************************************************************************** * Suggestions should be added in sorted order although a linear sorting method is * implemented. The list is then divided up based on the prefix provided by |