[Bf-blender-cvs] [b274d18aec5] blender-v2.90-release: Cleanup: correct usage of extern-C blocks in various places
Jacques Lucke
noreply at git.blender.org
Tue Jul 28 18:34:01 CEST 2020
Commit: b274d18aec525621bcb0a2234fc65e09398616c2
Author: Jacques Lucke
Date: Tue Jul 28 16:32:30 2020 +0200
Branches: blender-v2.90-release
https://developer.blender.org/rBb274d18aec525621bcb0a2234fc65e09398616c2
Cleanup: correct usage of extern-C blocks in various places
This removes extern-C blocks around other includes and adds
such blocks for some headers that need them.
===================================================================
M source/blender/blenkernel/intern/fcurve_test.cc
M source/blender/freestyle/intern/application/AppConfig.cpp
M source/blender/freestyle/intern/application/AppView.cpp
M source/blender/freestyle/intern/blender_interface/BlenderFileLoader.h
M source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp
M source/blender/freestyle/intern/stroke/BasicStrokeShaders.cpp
M source/blender/freestyle/intern/system/PythonInterpreter.h
M source/blender/freestyle/intern/system/RenderMonitor.h
M source/blender/freestyle/intern/system/StringUtils.h
M source/blender/gpu/GPU_framebuffer.h
M source/blender/gpu/GPU_texture.h
M source/blender/io/common/intern/hierarchy_context_order_test.cc
M source/blender/makesdna/DNA_genfile.h
M source/blender/python/intern/bpy.h
M source/blender/python/intern/bpy_app.h
M source/blender/python/intern/bpy_app_alembic.h
M source/blender/python/intern/bpy_app_build_options.h
M source/blender/python/intern/bpy_app_ffmpeg.h
M source/blender/python/intern/bpy_app_handlers.h
M source/blender/python/intern/bpy_app_icons.h
M source/blender/python/intern/bpy_app_ocio.h
M source/blender/python/intern/bpy_app_oiio.h
M source/blender/python/intern/bpy_app_opensubdiv.h
M source/blender/python/intern/bpy_app_openvdb.h
M source/blender/python/intern/bpy_app_sdl.h
M source/blender/python/intern/bpy_app_timers.h
M source/blender/python/intern/bpy_app_translations.h
M source/blender/python/intern/bpy_app_usd.h
M source/blender/python/intern/bpy_capi_utils.h
M source/blender/python/intern/bpy_driver.h
M source/blender/python/intern/bpy_gizmo_wrap.h
M source/blender/python/intern/bpy_intern_string.h
M source/blender/python/intern/bpy_library.h
M source/blender/python/intern/bpy_msgbus.h
M source/blender/python/intern/bpy_operator.h
M source/blender/python/intern/bpy_operator_wrap.h
M source/blender/python/intern/bpy_path.h
M source/blender/python/intern/bpy_props.h
M source/blender/python/intern/bpy_rna.h
M source/blender/python/intern/bpy_rna_anim.h
M source/blender/python/intern/bpy_rna_callback.h
M source/blender/python/intern/bpy_rna_driver.h
M source/blender/python/intern/bpy_rna_gizmo.h
M source/blender/python/intern/bpy_rna_id_collection.h
M source/blender/python/intern/bpy_rna_types_capi.h
M source/blender/python/intern/bpy_traceback.h
M source/blender/python/intern/bpy_utils_previews.h
M source/blender/python/intern/bpy_utils_units.h
M source/blender/render/extern/include/RE_bake.h
M source/blender/render/extern/include/RE_engine.h
M source/blender/render/extern/include/RE_multires_bake.h
M source/blender/render/extern/include/RE_render_ext.h
M source/blender/render/intern/include/initrender.h
M source/blender/render/intern/include/render_result.h
M source/blender/render/intern/include/render_types.h
M source/blender/render/intern/include/renderpipeline.h
M source/blender/render/intern/include/texture.h
M source/blender/render/intern/include/zbuf.h
M source/blender/windowmanager/gizmo/WM_gizmo_api.h
M source/blender/windowmanager/gizmo/WM_gizmo_types.h
M source/blender/windowmanager/gizmo/wm_gizmo_fn.h
M source/blender/windowmanager/gizmo/wm_gizmo_wmapi.h
M source/blender/windowmanager/message_bus/wm_message_bus.h
M source/blender/windowmanager/wm.h
M source/blender/windowmanager/wm_cursors.h
M source/blender/windowmanager/wm_draw.h
M source/blender/windowmanager/wm_event_system.h
M source/blender/windowmanager/wm_event_types.h
M source/blender/windowmanager/wm_files.h
M source/blender/windowmanager/wm_surface.h
M source/blender/windowmanager/wm_window.h
M tests/gtests/alembic/abc_export_test.cc
M tests/gtests/alembic/abc_matrix_test.cc
M tests/gtests/blenlib/BLI_array_store_test.cc
M tests/gtests/blenlib/BLI_array_utils_test.cc
M tests/gtests/blenlib/BLI_delaunay_2d_test.cc
M tests/gtests/blenlib/BLI_expr_pylike_eval_test.cc
M tests/gtests/blenlib/BLI_ghash_performance_test.cc
M tests/gtests/blenlib/BLI_ghash_test.cc
M tests/gtests/blenlib/BLI_hash_mm2a_test.cc
M tests/gtests/blenlib/BLI_heap_simple_test.cc
M tests/gtests/blenlib/BLI_heap_test.cc
M tests/gtests/blenlib/BLI_kdopbvh_test.cc
M tests/gtests/blenlib/BLI_listbase_test.cc
M tests/gtests/blenlib/BLI_memiter_test.cc
M tests/gtests/blenlib/BLI_path_util_test.cc
M tests/gtests/blenlib/BLI_polyfill_2d_test.cc
M tests/gtests/blenlib/BLI_stack_test.cc
M tests/gtests/blenlib/BLI_string_test.cc
M tests/gtests/blenlib/BLI_string_utf8_test.cc
M tests/gtests/blenlib/BLI_task_performance_test.cc
M tests/gtests/blenlib/BLI_task_test.cc
M tests/gtests/blenloader/blendfile_loading_base_test.cc
M tests/gtests/guardedalloc/guardedalloc_alignment_test.cc
===================================================================
diff --git a/source/blender/blenkernel/intern/fcurve_test.cc b/source/blender/blenkernel/intern/fcurve_test.cc
index 2248cce37e5..a6f65a7c9b3 100644
--- a/source/blender/blenkernel/intern/fcurve_test.cc
+++ b/source/blender/blenkernel/intern/fcurve_test.cc
@@ -19,13 +19,11 @@
#include "MEM_guardedalloc.h"
-extern "C" {
#include "BKE_fcurve.h"
#include "ED_keyframing.h"
#include "DNA_anim_types.h"
-}
namespace blender::bke::tests {
diff --git a/source/blender/freestyle/intern/application/AppConfig.cpp b/source/blender/freestyle/intern/application/AppConfig.cpp
index b26c9a58f70..3aae4254b4b 100644
--- a/source/blender/freestyle/intern/application/AppConfig.cpp
+++ b/source/blender/freestyle/intern/application/AppConfig.cpp
@@ -26,9 +26,7 @@
using namespace std;
-extern "C" {
#include "BKE_appdir.h"
-}
namespace Freestyle {
diff --git a/source/blender/freestyle/intern/application/AppView.cpp b/source/blender/freestyle/intern/application/AppView.cpp
index 0956d33a20e..5cd30a61712 100644
--- a/source/blender/freestyle/intern/application/AppView.cpp
+++ b/source/blender/freestyle/intern/application/AppView.cpp
@@ -33,7 +33,6 @@
#include "../view_map/Silhouette.h"
#include "../view_map/ViewMap.h"
-extern "C" {
#include "BLI_blenlib.h"
#include "IMB_imbuf.h"
@@ -45,7 +44,6 @@ extern "C" {
#endif
#include "FRS_freestyle.h"
-}
namespace Freestyle {
diff --git a/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.h b/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.h
index d9387b221f8..9d8b7e55fbb 100644
--- a/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.h
+++ b/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.h
@@ -37,7 +37,6 @@
#include "MEM_guardedalloc.h"
-extern "C" {
#include "DNA_material_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
@@ -56,7 +55,6 @@ extern "C" {
#include "BLI_iterator.h"
#include "BLI_listbase.h"
#include "BLI_math.h"
-}
#include "DEG_depsgraph_query.h"
diff --git a/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp b/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp
index 26070a88e5d..51ac281e330 100644
--- a/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp
+++ b/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp
@@ -34,8 +34,6 @@ using namespace Freestyle;
#include "MEM_guardedalloc.h"
-extern "C" {
-
#include "DNA_camera_types.h"
#include "DNA_collection_types.h"
#include "DNA_freestyle_types.h"
@@ -65,6 +63,8 @@ extern "C" {
#include "FRS_freestyle.h"
+extern "C" {
+
#define DEFAULT_SPHERE_RADIUS 1.0f
#define DEFAULT_DKR_EPSILON 0.0f
diff --git a/source/blender/freestyle/intern/stroke/BasicStrokeShaders.cpp b/source/blender/freestyle/intern/stroke/BasicStrokeShaders.cpp
index d969e0e50a3..36234ad619c 100644
--- a/source/blender/freestyle/intern/stroke/BasicStrokeShaders.cpp
+++ b/source/blender/freestyle/intern/stroke/BasicStrokeShaders.cpp
@@ -37,10 +37,8 @@
#include "BKE_global.h"
-extern "C" {
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
-}
namespace Freestyle {
diff --git a/source/blender/freestyle/intern/system/PythonInterpreter.h b/source/blender/freestyle/intern/system/PythonInterpreter.h
index 4bc6ba9db38..8099ed63199 100644
--- a/source/blender/freestyle/intern/system/PythonInterpreter.h
+++ b/source/blender/freestyle/intern/system/PythonInterpreter.h
@@ -34,7 +34,6 @@ extern "C" {
#include "MEM_guardedalloc.h"
// soc
-extern "C" {
#include "DNA_text_types.h"
#include "BKE_context.h"
@@ -47,7 +46,6 @@ extern "C" {
#include "BPY_extern.h"
#include "bpy_capi_utils.h"
-}
namespace Freestyle {
diff --git a/source/blender/freestyle/intern/system/RenderMonitor.h b/source/blender/freestyle/intern/system/RenderMonitor.h
index 709df6c2d8e..eef4683328b 100644
--- a/source/blender/freestyle/intern/system/RenderMonitor.h
+++ b/source/blender/freestyle/intern/system/RenderMonitor.h
@@ -22,9 +22,7 @@
* \brief Classes defining the basic "Iterator" design pattern
*/
-extern "C" {
#include "render_types.h"
-}
#ifdef WITH_CXX_GUARDEDALLOC
# include "MEM_guardedalloc.h"
diff --git a/source/blender/freestyle/intern/system/StringUtils.h b/source/blender/freestyle/intern/system/StringUtils.h
index aeacddd64c8..fd97ca5b032 100644
--- a/source/blender/freestyle/intern/system/StringUtils.h
+++ b/source/blender/freestyle/intern/system/StringUtils.h
@@ -28,10 +28,8 @@
#include <string>
#include <vector>
-extern "C" {
#include "BLI_path_util.h"
#include "BLI_string.h"
-}
using namespace std;
diff --git a/source/blender/gpu/GPU_framebuffer.h b/source/blender/gpu/GPU_framebuffer.h
index 1a9fb1bad7a..0a43b2c58a0 100644
--- a/source/blender/gpu/GPU_framebuffer.h
+++ b/source/blender/gpu/GPU_framebuffer.h
@@ -24,12 +24,12 @@
#ifndef __GPU_FRAMEBUFFER_H__
#define __GPU_FRAMEBUFFER_H__
+#include "GPU_texture.h"
+
#ifdef __cplusplus
extern "C" {
#endif
-#include "GPU_texture.h"
-
typedef struct GPUAttachment {
struct GPUTexture *tex;
int mip, layer;
diff --git a/source/blender/gpu/GPU_texture.h b/source/blender/gpu/GPU_texture.h
index 813ee71eb22..100965d7076 100644
--- a/source/blender/gpu/GPU_texture.h
+++ b/source/blender/gpu/GPU_texture.h
@@ -24,12 +24,9 @@
#ifndef __GPU_TEXTURE_H__
#define __GPU_TEXTURE_H__
+#include "BLI_utildefines.h"
#include "GPU_state.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
struct GPUVertBuf;
struct ImBuf;
struct Image;
@@ -60,6 +57,12 @@ typedef enum eGPUSamplerState {
GPU_SAMPLER_MAX = (1 << 8),
} eGPUSamplerState;
+ENUM_OPERATORS(eGPUSamplerState)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define GPU_SAMPLER_DEFAULT GPU_SAMPLER_FILTER
#define GPU_SAMPLER_REPEAT (GPU_SAMPLER_REPEAT_S | GPU_SAMPLER_REPEAT_T | GPU_SAMPLER_REPEAT_R)
diff --git a/source/blender/io/common/intern/hierarchy_context_order_test.cc b/source/blender/io/common/intern/hierarchy_context_order_test.cc
index 7273b92c479..f4e2b81b39b 100644
--- a/source/blender/io/common/intern/hierarchy_context_order_test.cc
+++ b/source/blender/io/common/intern/hierarchy_context_order_test.cc
@@ -20,9 +20,7 @@
#include "testing/testing.h"
-extern "C" {
#include "BLI_utildefines.h"
-}
namespace blender::io {
diff --git a/source/blender/makesdna/DNA_genfile.h b/source/blender/makesdna/DNA_genfile.h
index db65da6fa75..6366412f0cf 100644
--- a/source/blender/makesdna/DNA_genfile.h
+++ b/source/blender/makesdna/DNA_genfile.h
@@ -29,6 +29,10 @@
struct SDNA;
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* DNAstr contains the prebuilt SDNA structure defining the layouts of the types
* used by this version of Blender. It is defined in a file dna.c, which is
@@ -134,4 +138,8 @@ bool DNA_struct_alias_elem_find(const struct SDNA *sdna,
const char *name);
void DNA_sdna_alias_data_ensure_structs_map(struct SDNA *sdna);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* __DNA_GENFILE_H__ */
diff --git a/source/blender/python/intern/bpy.h b/source/blender/python/intern/bpy.h
index 88d1db6f8bc..8f91c4e1208 100644
--- a/source/blender/python/intern/bpy.h
+++ b/source/blender/python/intern/bpy.h
@@ -21,6 +21,10 @@
#ifndef __BPY_H__
#define __BPY_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void BPy_init_modules(void);
extern PyObject *bpy_package_py;
@@ -31,4 +35,8 @@ void BPY_atexit_unregister(void);
extern struct CLG_LogRef *BPY_LOG_CONTEXT;
extern struct CLG_LogRef *BPY_LOG_RNA;
+#ifdef __cplusplus
+}
+#endif
+
#endif /* __BPY_H__ */
diff --git a/source/blender/python/intern/bpy_app.h b/source/blender/python/intern/bpy_app.h
index b46de025599..880686f3536 100644
--- a/source/blender/python/intern/bpy_app.h
+++ b/source/blender/python/intern/bpy_app.h
@@ -21,6 +21,14 @@
#ifndef __BPY_APP_H__
#define __BPY_APP_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
PyObject *BPY_app_struct(void);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* __BPY_APP_H__ */
diff --git a/source/blender/python/intern/bpy_app_alembic.h b/source/blender/python/intern/bpy_app_alembic.h
index 4cc890ec64d..fcd93fb2b13 100644
--- a/source/blender/python/intern/bpy_app_alembic.h
+++ b/source/blender/python/intern/bpy_app_alembic.h
@@ -24,6 +24,14 @@
#ifndef __BPY_APP_ALEMBIC_H__
#define __BPY_APP_ALEMBIC_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
PyObject *BPY_app_alembic_struct(void);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* __BPY_APP_ALEMBIC_H__ */
diff --git a/source/blender/python/intern/bpy_app_build_options.h b/source/blender/python/intern/bpy_app_build_options.h
index 52c2e57c12a..a10f42d53be 100644
--- a/source/blender/python/intern/bpy_app_build_options.h
+++ b/source/blender/python/intern/bpy_app_build_options.h
@@ -21,6 +21,14 @@
#ifndef __BPY_APP_BUILD_OPTIONS_H__
#define __BPY_APP_BUILD_OPTIONS_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
PyObject *BPY_app_build_options_struct(void);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* __BPY_APP_BUILD_OPTIONS_H__ */
diff --git a/source/blender/python/intern/bpy_app_ffmpeg.h b/source/blender/python/intern/bpy_app_ffmpeg.h
index 63fff2b1b4b..4809288662b 100644
--- a/source/blender/python/intern/bpy_app_ffmpeg.h
+++ b/source/blender/python/intern/bpy_app_ffmpeg.h
@@ -21,6 +21,14 @@
#ifndef __BPY_APP_FFMPEG_H__
#define __BPY_APP_FFMPEG_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
PyObject *BPY_app_ffmpeg_struct(void);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* __BPY_APP_FFMPEG_H__ */
diff --git a/source/blender/python/intern/bpy_app_handlers.h b/source/blender/python/intern/bpy_app_handlers.h
index 426fe376b55..9c9dd75dd18 100644
--- a/source/blender/python/intern/bpy_app_handlers.h
+++ b/source/blender/python/intern/bpy_app_handlers.h
@@ -21,6 +21,14 @@
#ifndef __BPY_APP_HANDLERS_H__
#define __BPY_APP_HANDLERS_H__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
PyObject *BPY_app_handlers_struct(void);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* __BPY_APP_HANDLERS_H__ */
diff --git a/source/blender/python/intern/bpy_app_icons.h b/source/blender/python/intern/bpy_app_icons.h
index 2d7cb96aae7..2904dc06136 100644
-
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list