Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2020-01-26 18:38:18 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2020-01-27 14:22:01 +0300
commit1107af1abb0d4bf271e995a18f5d4bd790d51d02 (patch)
treea5cc6e1390176cdb62bf40870d4dd5a5b18ee617
parent9cacadc8a637cc6c96380f73c4bfd1d6967351bd (diff)
Fix OBJECT_GUARDED_FREE compiler error when type is in namespace
-rw-r--r--intern/guardedalloc/MEM_guardedalloc.h17
-rw-r--r--source/blender/alembic/intern/abc_curves.cc2
-rw-r--r--source/blender/alembic/intern/abc_hair.cc2
-rw-r--r--source/blender/alembic/intern/abc_mball.cc3
-rw-r--r--source/blender/alembic/intern/abc_mesh.cc4
-rw-r--r--source/blender/alembic/intern/abc_nurbs.cc2
-rw-r--r--source/blender/alembic/intern/alembic_capi.cc2
-rw-r--r--source/blender/collada/BCAnimationCurve.h3
-rw-r--r--source/blender/collada/DocumentExporter.cpp4
-rw-r--r--source/blender/collada/DocumentImporter.cpp4
-rw-r--r--source/blender/collada/MeshImporter.cpp4
-rw-r--r--source/blender/collada/collada_utils.cpp5
-rw-r--r--source/blender/compositor/operations/COM_CompositorOperation.cpp2
-rw-r--r--source/blender/compositor/operations/COM_ImageOperation.h2
-rw-r--r--source/blender/compositor/operations/COM_OutputFileOperation.cpp2
-rw-r--r--source/blender/compositor/operations/COM_PreviewOperation.cpp2
-rw-r--r--source/blender/compositor/operations/COM_RenderLayersProg.h2
-rw-r--r--source/blender/compositor/operations/COM_SplitOperation.cpp2
-rw-r--r--source/blender/compositor/operations/COM_TextureOperation.h2
-rw-r--r--source/blender/compositor/operations/COM_ViewerOperation.cpp2
-rw-r--r--source/blender/freestyle/intern/blender_interface/BlenderFileLoader.h2
-rw-r--r--source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp2
-rw-r--r--source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp4
-rw-r--r--source/blender/freestyle/intern/system/PythonInterpreter.h4
-rw-r--r--source/blender/imbuf/intern/oiio/openimageio_api.cpp2
-rw-r--r--source/blender/imbuf/intern/openexr/openexr_api.cpp4
-rw-r--r--source/blender/physics/intern/BPH_mass_spring.cpp2
-rw-r--r--source/blender/usd/intern/usd_capi.cc4
-rw-r--r--tests/gtests/blenlib/BLI_array_store_test.cc4
-rw-r--r--tests/gtests/blenlib/BLI_delaunay_2d_test.cc3
-rw-r--r--tests/gtests/blenlib/BLI_ghash_performance_test.cc3
-rw-r--r--tests/gtests/blenlib/BLI_heap_simple_test.cc4
-rw-r--r--tests/gtests/blenlib/BLI_heap_test.cc4
-rw-r--r--tests/gtests/blenlib/BLI_kdopbvh_test.cc3
-rw-r--r--tests/gtests/blenlib/BLI_listbase_test.cc4
-rw-r--r--tests/gtests/blenlib/BLI_memiter_test.cc3
-rw-r--r--tests/gtests/blenlib/BLI_polyfill_2d_test.cc3
-rw-r--r--tests/gtests/blenlib/BLI_task_performance_test.cc4
-rw-r--r--tests/gtests/blenlib/BLI_task_test.cc4
-rw-r--r--tests/gtests/blenloader/blendfile_loading_base_test.cc4
40 files changed, 75 insertions, 60 deletions
diff --git a/intern/guardedalloc/MEM_guardedalloc.h b/intern/guardedalloc/MEM_guardedalloc.h
index b1a0eda0e22..958e5ae86cd 100644
--- a/intern/guardedalloc/MEM_guardedalloc.h
+++ b/intern/guardedalloc/MEM_guardedalloc.h
@@ -231,6 +231,10 @@ extern const char *(*MEM_name_ptr)(void *vmemh);
void MEM_use_guarded_allocator(void);
#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#ifdef __cplusplus
/* alloc funcs for C++ only */
# define MEM_CXX_CLASS_ALLOC_FUNCS(_id) \
public: \
@@ -253,6 +257,13 @@ void MEM_use_guarded_allocator(void);
MEM_freeN(mem); \
}
+/* Needed when type includes a namespace, then the namespace should not be
+ * specified after ~, so using a macro fails. */
+template<class T> inline void OBJECT_GUARDED_DESTRUCTOR(T *what)
+{
+ what->~T();
+}
+
# if defined __GNUC__
# define OBJECT_GUARDED_NEW(type, args...) new (MEM_mallocN(sizeof(type), __func__)) type(args)
# else
@@ -262,15 +273,11 @@ void MEM_use_guarded_allocator(void);
# define OBJECT_GUARDED_DELETE(what, type) \
{ \
if (what) { \
- ((type *)(what))->~type(); \
+ OBJECT_GUARDED_DESTRUCTOR((type *)what); \
MEM_freeN(what); \
} \
} \
(void)0
#endif /* __cplusplus */
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
#endif /* __MEM_GUARDEDALLOC_H__ */
diff --git a/source/blender/alembic/intern/abc_curves.cc b/source/blender/alembic/intern/abc_curves.cc
index 50aa13bea4f..3b143356c04 100644
--- a/source/blender/alembic/intern/abc_curves.cc
+++ b/source/blender/alembic/intern/abc_curves.cc
@@ -28,9 +28,9 @@
#include "abc_transform.h"
#include "abc_util.h"
-extern "C" {
#include "MEM_guardedalloc.h"
+extern "C" {
#include "DNA_curve_types.h"
#include "DNA_object_types.h"
diff --git a/source/blender/alembic/intern/abc_hair.cc b/source/blender/alembic/intern/abc_hair.cc
index 98387be2e61..7eaecd271f4 100644
--- a/source/blender/alembic/intern/abc_hair.cc
+++ b/source/blender/alembic/intern/abc_hair.cc
@@ -25,9 +25,9 @@
#include "abc_transform.h"
#include "abc_util.h"
-extern "C" {
#include "MEM_guardedalloc.h"
+extern "C" {
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_modifier_types.h"
diff --git a/source/blender/alembic/intern/abc_mball.cc b/source/blender/alembic/intern/abc_mball.cc
index 732ceffe467..db4b9d82ebf 100644
--- a/source/blender/alembic/intern/abc_mball.cc
+++ b/source/blender/alembic/intern/abc_mball.cc
@@ -22,6 +22,8 @@
#include "abc_mesh.h"
#include "abc_transform.h"
+#include "MEM_guardedalloc.h"
+
extern "C" {
#include "DNA_meta_types.h"
#include "DNA_mesh_types.h"
@@ -35,7 +37,6 @@ extern "C" {
#include "BKE_object.h"
#include "DEG_depsgraph.h"
-#include "MEM_guardedalloc.h"
}
AbcMBallWriter::AbcMBallWriter(Main *bmain,
diff --git a/source/blender/alembic/intern/abc_mesh.cc b/source/blender/alembic/intern/abc_mesh.cc
index edcb6263da3..3eee390d7d3 100644
--- a/source/blender/alembic/intern/abc_mesh.cc
+++ b/source/blender/alembic/intern/abc_mesh.cc
@@ -25,6 +25,8 @@
#include "abc_transform.h"
#include "abc_util.h"
+#include "MEM_guardedalloc.h"
+
extern "C" {
#include "DNA_material_types.h"
#include "DNA_mesh_types.h"
@@ -46,8 +48,6 @@ extern "C" {
#include "BKE_modifier.h"
#include "BKE_object.h"
-#include "MEM_guardedalloc.h"
-
#include "WM_api.h"
#include "WM_types.h"
diff --git a/source/blender/alembic/intern/abc_nurbs.cc b/source/blender/alembic/intern/abc_nurbs.cc
index 739276dffa6..c11ca7d57b9 100644
--- a/source/blender/alembic/intern/abc_nurbs.cc
+++ b/source/blender/alembic/intern/abc_nurbs.cc
@@ -23,9 +23,9 @@
#include "abc_transform.h"
#include "abc_util.h"
-extern "C" {
#include "MEM_guardedalloc.h"
+extern "C" {
#include "DNA_curve_types.h"
#include "DNA_object_types.h"
diff --git a/source/blender/alembic/intern/alembic_capi.cc b/source/blender/alembic/intern/alembic_capi.cc
index 5efa8c8a446..5519cbef53c 100644
--- a/source/blender/alembic/intern/alembic_capi.cc
+++ b/source/blender/alembic/intern/alembic_capi.cc
@@ -32,9 +32,9 @@
#include "abc_transform.h"
#include "abc_util.h"
-extern "C" {
#include "MEM_guardedalloc.h"
+extern "C" {
#include "DNA_cachefile_types.h"
#include "DNA_curve_types.h"
#include "DNA_modifier_types.h"
diff --git a/source/blender/collada/BCAnimationCurve.h b/source/blender/collada/BCAnimationCurve.h
index 4651290ea0f..7b523ac53ca 100644
--- a/source/blender/collada/BCAnimationCurve.h
+++ b/source/blender/collada/BCAnimationCurve.h
@@ -23,8 +23,9 @@
#include "collada_utils.h"
#include "BCSampleData.h"
-extern "C" {
#include "MEM_guardedalloc.h"
+
+extern "C" {
#include "BKE_fcurve.h"
#include "BKE_armature.h"
#include "BKE_material.h"
diff --git a/source/blender/collada/DocumentExporter.cpp b/source/blender/collada/DocumentExporter.cpp
index 0ebcd6d0919..24a960ab287 100644
--- a/source/blender/collada/DocumentExporter.cpp
+++ b/source/blender/collada/DocumentExporter.cpp
@@ -56,6 +56,8 @@
#include "COLLADASWInstanceNode.h"
#include "COLLADASWBaseInputElement.h"
+#include "MEM_guardedalloc.h"
+
extern "C" {
#include "DNA_scene_types.h"
#include "DNA_object_types.h"
@@ -99,8 +101,6 @@ extern char build_commit_time[];
extern char build_hash[];
#endif
-#include "MEM_guardedalloc.h"
-
#include "RNA_access.h"
}
diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp
index 30e41a8d720..f2c52b125a4 100644
--- a/source/blender/collada/DocumentImporter.cpp
+++ b/source/blender/collada/DocumentImporter.cpp
@@ -43,6 +43,8 @@
#include "COLLADASaxFWLLoader.h"
#include "COLLADASaxFWLIExtraDataCallbackHandler.h"
+#include "MEM_guardedalloc.h"
+
extern "C" {
#include "BLI_listbase.h"
#include "BLI_math.h"
@@ -68,8 +70,6 @@ extern "C" {
#include "RNA_access.h"
-#include "MEM_guardedalloc.h"
-
#include "WM_api.h"
#include "WM_types.h"
}
diff --git a/source/blender/collada/MeshImporter.cpp b/source/blender/collada/MeshImporter.cpp
index e02a7a014f1..8ed30a0dc81 100644
--- a/source/blender/collada/MeshImporter.cpp
+++ b/source/blender/collada/MeshImporter.cpp
@@ -31,6 +31,8 @@
#include "COLLADAFWMeshVertexData.h"
#include "COLLADAFWPolygons.h"
+#include "MEM_guardedalloc.h"
+
extern "C" {
#include "BKE_customdata.h"
#include "BKE_displist.h"
@@ -44,8 +46,6 @@ extern "C" {
#include "BLI_math.h"
#include "BLI_string.h"
#include "BLI_edgehash.h"
-
-#include "MEM_guardedalloc.h"
}
#include "ArmatureImporter.h"
diff --git a/source/blender/collada/collada_utils.cpp b/source/blender/collada/collada_utils.cpp
index d5011581204..5db4609c7c2 100644
--- a/source/blender/collada/collada_utils.cpp
+++ b/source/blender/collada/collada_utils.cpp
@@ -27,6 +27,9 @@
#include <set>
#include <string>
+
+#include "MEM_guardedalloc.h"
+
extern "C" {
#include "DNA_modifier_types.h"
#include "DNA_customdata_types.h"
@@ -62,8 +65,6 @@ extern "C" {
#include "ED_node.h"
#include "ED_object.h"
-#include "MEM_guardedalloc.h"
-
#include "WM_api.h" /* XXX hrm, see if we can do without this */
#include "WM_types.h"
diff --git a/source/blender/compositor/operations/COM_CompositorOperation.cpp b/source/blender/compositor/operations/COM_CompositorOperation.cpp
index 5bd466658c0..ff9fc7dbcbc 100644
--- a/source/blender/compositor/operations/COM_CompositorOperation.cpp
+++ b/source/blender/compositor/operations/COM_CompositorOperation.cpp
@@ -17,6 +17,7 @@
*/
#include "COM_CompositorOperation.h"
+#include "MEM_guardedalloc.h"
#include "BLI_listbase.h"
#include "BKE_global.h"
#include "BKE_image.h"
@@ -26,7 +27,6 @@ extern "C" {
#include "RE_pipeline.h"
#include "RE_shader_ext.h"
#include "RE_render_ext.h"
-#include "MEM_guardedalloc.h"
#include "render_types.h"
}
#include "PIL_time.h"
diff --git a/source/blender/compositor/operations/COM_ImageOperation.h b/source/blender/compositor/operations/COM_ImageOperation.h
index e03173dca8d..6237d336c74 100644
--- a/source/blender/compositor/operations/COM_ImageOperation.h
+++ b/source/blender/compositor/operations/COM_ImageOperation.h
@@ -20,13 +20,13 @@
#define __COM_IMAGEOPERATION_H__
#include "COM_NodeOperation.h"
+#include "MEM_guardedalloc.h"
#include "BLI_listbase.h"
#include "BKE_image.h"
extern "C" {
#include "RE_pipeline.h"
#include "RE_shader_ext.h"
#include "RE_render_ext.h"
-#include "MEM_guardedalloc.h"
}
/**
diff --git a/source/blender/compositor/operations/COM_OutputFileOperation.cpp b/source/blender/compositor/operations/COM_OutputFileOperation.cpp
index c06994d7cdb..334eab6ef95 100644
--- a/source/blender/compositor/operations/COM_OutputFileOperation.cpp
+++ b/source/blender/compositor/operations/COM_OutputFileOperation.cpp
@@ -30,9 +30,9 @@
#include "BKE_scene.h"
#include "DNA_color_types.h"
+#include "MEM_guardedalloc.h"
extern "C" {
-#include "MEM_guardedalloc.h"
#include "IMB_imbuf.h"
#include "IMB_colormanagement.h"
#include "IMB_imbuf_types.h"
diff --git a/source/blender/compositor/operations/COM_PreviewOperation.cpp b/source/blender/compositor/operations/COM_PreviewOperation.cpp
index cd2bb3b2928..b91c3324f87 100644
--- a/source/blender/compositor/operations/COM_PreviewOperation.cpp
+++ b/source/blender/compositor/operations/COM_PreviewOperation.cpp
@@ -26,8 +26,8 @@
#include "BLI_math_color.h"
#include "COM_defines.h"
#include "BLI_math.h"
-extern "C" {
#include "MEM_guardedalloc.h"
+extern "C" {
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
#include "IMB_colormanagement.h"
diff --git a/source/blender/compositor/operations/COM_RenderLayersProg.h b/source/blender/compositor/operations/COM_RenderLayersProg.h
index 5aa7e879760..ca7c18a0586 100644
--- a/source/blender/compositor/operations/COM_RenderLayersProg.h
+++ b/source/blender/compositor/operations/COM_RenderLayersProg.h
@@ -20,12 +20,12 @@
#define __COM_RENDERLAYERSPROG_H__
#include "COM_NodeOperation.h"
+#include "MEM_guardedalloc.h"
#include "DNA_scene_types.h"
#include "BLI_listbase.h"
#include "BKE_image.h"
extern "C" {
#include "RE_pipeline.h"
-#include "MEM_guardedalloc.h"
}
/**
diff --git a/source/blender/compositor/operations/COM_SplitOperation.cpp b/source/blender/compositor/operations/COM_SplitOperation.cpp
index 24978acc8f3..437b20d14d4 100644
--- a/source/blender/compositor/operations/COM_SplitOperation.cpp
+++ b/source/blender/compositor/operations/COM_SplitOperation.cpp
@@ -22,9 +22,9 @@
#include "BLI_utildefines.h"
#include "BLI_math_color.h"
#include "BLI_math_vector.h"
+#include "MEM_guardedalloc.h"
extern "C" {
-#include "MEM_guardedalloc.h"
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
}
diff --git a/source/blender/compositor/operations/COM_TextureOperation.h b/source/blender/compositor/operations/COM_TextureOperation.h
index 934b6f8683f..6b44c11f423 100644
--- a/source/blender/compositor/operations/COM_TextureOperation.h
+++ b/source/blender/compositor/operations/COM_TextureOperation.h
@@ -22,11 +22,11 @@
#include "COM_NodeOperation.h"
#include "DNA_texture_types.h"
#include "BLI_listbase.h"
+#include "MEM_guardedalloc.h"
extern "C" {
#include "RE_pipeline.h"
#include "RE_shader_ext.h"
#include "RE_render_ext.h"
-#include "MEM_guardedalloc.h"
}
/**
diff --git a/source/blender/compositor/operations/COM_ViewerOperation.cpp b/source/blender/compositor/operations/COM_ViewerOperation.cpp
index b6caf52a9f7..50b508dafb1 100644
--- a/source/blender/compositor/operations/COM_ViewerOperation.cpp
+++ b/source/blender/compositor/operations/COM_ViewerOperation.cpp
@@ -26,9 +26,9 @@
#include "BLI_utildefines.h"
#include "BLI_math_color.h"
#include "BLI_math_vector.h"
+#include "MEM_guardedalloc.h"
extern "C" {
-#include "MEM_guardedalloc.h"
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
#include "IMB_colormanagement.h"
diff --git a/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.h b/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.h
index dc6677bdcf4..8b125828fdc 100644
--- a/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.h
+++ b/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.h
@@ -35,9 +35,9 @@
#include "../system/FreestyleConfig.h"
#include "../system/RenderMonitor.h"
-extern "C" {
#include "MEM_guardedalloc.h"
+extern "C" {
#include "DNA_material_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
diff --git a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp
index 06087cd7fa6..56ff733483f 100644
--- a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp
+++ b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp
@@ -23,9 +23,9 @@
#include "../application/AppConfig.h"
#include "../stroke/Canvas.h"
-extern "C" {
#include "MEM_guardedalloc.h"
+extern "C" {
#include "RNA_access.h"
#include "RNA_types.h"
diff --git a/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp b/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp
index 07839ac6e61..0567bd0df06 100644
--- a/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp
+++ b/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp
@@ -32,10 +32,10 @@
using namespace std;
using namespace Freestyle;
-extern "C" {
-
#include "MEM_guardedalloc.h"
+extern "C" {
+
#include "DNA_camera_types.h"
#include "DNA_collection_types.h"
#include "DNA_freestyle_types.h"
diff --git a/source/blender/freestyle/intern/system/PythonInterpreter.h b/source/blender/freestyle/intern/system/PythonInterpreter.h
index 1fed6a00463..255a1b2a152 100644
--- a/source/blender/freestyle/intern/system/PythonInterpreter.h
+++ b/source/blender/freestyle/intern/system/PythonInterpreter.h
@@ -31,10 +31,10 @@ extern "C" {
#include "StringUtils.h"
#include "Interpreter.h"
-// soc
-extern "C" {
#include "MEM_guardedalloc.h"
+// soc
+extern "C" {
#include "DNA_text_types.h"
#include "BKE_context.h"
diff --git a/source/blender/imbuf/intern/oiio/openimageio_api.cpp b/source/blender/imbuf/intern/oiio/openimageio_api.cpp
index d2147f833c3..e001b8b21c4 100644
--- a/source/blender/imbuf/intern/oiio/openimageio_api.cpp
+++ b/source/blender/imbuf/intern/oiio/openimageio_api.cpp
@@ -33,9 +33,9 @@
#include "openimageio_api.h"
#include <OpenImageIO/imageio.h>
-extern "C" {
#include "MEM_guardedalloc.h"
+extern "C" {
#include "BLI_blenlib.h"
#include "IMB_imbuf_types.h"
diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp
index 88dfa42a416..e1513169736 100644
--- a/source/blender/imbuf/intern/openexr/openexr_api.cpp
+++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp
@@ -65,6 +65,8 @@
# include "utfconv.h"
#endif
+#include "MEM_guardedalloc.h"
+
extern "C" {
// The following prevents a linking error in debug mode for MSVC using the libs in CVS
@@ -74,8 +76,6 @@ _CRTIMP void __cdecl _invalid_parameter_noinfo(void)
}
#endif
-#include "MEM_guardedalloc.h"
-
#include "BLI_blenlib.h"
#include "BLI_math_color.h"
#include "BLI_threads.h"
diff --git a/source/blender/physics/intern/BPH_mass_spring.cpp b/source/blender/physics/intern/BPH_mass_spring.cpp
index fcfd713e6be..8f079a75f14 100644
--- a/source/blender/physics/intern/BPH_mass_spring.cpp
+++ b/source/blender/physics/intern/BPH_mass_spring.cpp
@@ -21,9 +21,9 @@
* \ingroup bph
*/
-extern "C" {
#include "MEM_guardedalloc.h"
+extern "C" {
#include "DNA_cloth_types.h"
#include "DNA_scene_types.h"
#include "DNA_object_force_types.h"
diff --git a/source/blender/usd/intern/usd_capi.cc b/source/blender/usd/intern/usd_capi.cc
index 502f8677174..f8391700324 100644
--- a/source/blender/usd/intern/usd_capi.cc
+++ b/source/blender/usd/intern/usd_capi.cc
@@ -23,6 +23,8 @@
#include <pxr/usd/usd/stage.h>
#include <pxr/usd/usdGeom/tokens.h>
+#include "MEM_guardedalloc.h"
+
extern "C" {
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_build.h"
@@ -39,8 +41,6 @@ extern "C" {
#include "BLI_path_util.h"
#include "BLI_string.h"
-#include "MEM_guardedalloc.h"
-
#include "WM_api.h"
#include "WM_types.h"
}
diff --git a/tests/gtests/blenlib/BLI_array_store_test.cc b/tests/gtests/blenlib/BLI_array_store_test.cc
index 632107c69df..3bca66b613e 100644
--- a/tests/gtests/blenlib/BLI_array_store_test.cc
+++ b/tests/gtests/blenlib/BLI_array_store_test.cc
@@ -2,10 +2,10 @@
#include "testing/testing.h"
+#include "MEM_guardedalloc.h"
+
extern "C" {
#include "BLI_array_store.h"
-
-#include "MEM_guardedalloc.h"
#include "BLI_sys_types.h"
#include "BLI_utildefines.h"
#include "BLI_listbase.h"
diff --git a/tests/gtests/blenlib/BLI_delaunay_2d_test.cc b/tests/gtests/blenlib/BLI_delaunay_2d_test.cc
index 85e8ae3f141..946dc03eca3 100644
--- a/tests/gtests/blenlib/BLI_delaunay_2d_test.cc
+++ b/tests/gtests/blenlib/BLI_delaunay_2d_test.cc
@@ -2,8 +2,9 @@
#include "testing/testing.h"
-extern "C" {
#include "MEM_guardedalloc.h"
+
+extern "C" {
#include "BLI_math.h"
#include "BLI_rand.h"
#include "PIL_time.h"
diff --git a/tests/gtests/blenlib/BLI_ghash_performance_test.cc b/tests/gtests/blenlib/BLI_ghash_performance_test.cc
index ba995e5014f..58dd9998733 100644
--- a/tests/gtests/blenlib/BLI_ghash_performance_test.cc
+++ b/tests/gtests/blenlib/BLI_ghash_performance_test.cc
@@ -5,8 +5,9 @@
#define GHASH_INTERNAL_API
-extern "C" {
#include "MEM_guardedalloc.h"
+
+extern "C" {
#include "BLI_utildefines.h"
#include "BLI_ghash.h"
#include "BLI_rand.h"
diff --git a/tests/gtests/blenlib/BLI_heap_simple_test.cc b/tests/gtests/blenlib/BLI_heap_simple_test.cc
index 16e1ecbf9cf..bad5c40eb66 100644
--- a/tests/gtests/blenlib/BLI_heap_simple_test.cc
+++ b/tests/gtests/blenlib/BLI_heap_simple_test.cc
@@ -3,14 +3,14 @@
#include "testing/testing.h"
#include <string.h>
+#include "MEM_guardedalloc.h"
+
extern "C" {
#include "BLI_sys_types.h"
#include "BLI_compiler_attrs.h"
#include "BLI_heap_simple.h"
#include "BLI_utildefines.h"
#include "BLI_rand.h"
-
-#include "MEM_guardedalloc.h"
};
#define SIZE 1024
diff --git a/tests/gtests/blenlib/BLI_heap_test.cc b/tests/gtests/blenlib/BLI_heap_test.cc
index 884093435e4..ddec706eb0e 100644
--- a/tests/gtests/blenlib/BLI_heap_test.cc
+++ b/tests/gtests/blenlib/BLI_heap_test.cc
@@ -3,13 +3,13 @@
#include "testing/testing.h"
#include <string.h>
+#include "MEM_guardedalloc.h"
+
extern "C" {
#include "BLI_compiler_attrs.h"
#include "BLI_heap.h"
#include "BLI_utildefines.h"
#include "BLI_rand.h"
-
-#include "MEM_guardedalloc.h"
};
#define SIZE 1024
diff --git a/tests/gtests/blenlib/BLI_kdopbvh_test.cc b/tests/gtests/blenlib/BLI_kdopbvh_test.cc
index 7e32c545e75..e0762f22840 100644
--- a/tests/gtests/blenlib/BLI_kdopbvh_test.cc
+++ b/tests/gtests/blenlib/BLI_kdopbvh_test.cc
@@ -4,12 +4,13 @@
/* TODO: ray intersection, overlap ... etc.*/
+#include "MEM_guardedalloc.h"
+
extern "C" {
#include "BLI_compiler_attrs.h"
#include "BLI_kdopbvh.h"
#include "BLI_rand.h"
#include "BLI_math_vector.h"
-#include "MEM_guardedalloc.h"
}
#include "stubs/bf_intern_eigen_stubs.h"
diff --git a/tests/gtests/blenlib/BLI_listbase_test.cc b/tests/gtests/blenlib/BLI_listbase_test.cc
index e5919c5dfb1..5ecf0533763 100644
--- a/tests/gtests/blenlib/BLI_listbase_test.cc
+++ b/tests/gtests/blenlib/BLI_listbase_test.cc
@@ -2,11 +2,11 @@
#include "testing/testing.h"
+#include "MEM_guardedalloc.h"
+
extern "C" {
#include "BLI_array_utils.h"
#include "BLI_listbase.h"
-#include "MEM_guardedalloc.h"
-
#include "BLI_string.h"
#include "BLI_path_util.h"
#include "BLI_ressource_strings.h"
diff --git a/tests/gtests/blenlib/BLI_memiter_test.cc b/tests/gtests/blenlib/BLI_memiter_test.cc
index d92daefff3b..07ef0745845 100644
--- a/tests/gtests/blenlib/BLI_memiter_test.cc
+++ b/tests/gtests/blenlib/BLI_memiter_test.cc
@@ -2,10 +2,11 @@
#include "testing/testing.h"
+#include "MEM_guardedalloc.h"
+
extern "C" {
#include "BLI_array_utils.h"
#include "BLI_memiter.h"
-#include "MEM_guardedalloc.h"
#include "BLI_string.h"
#include "BLI_ressource_strings.h"
diff --git a/tests/gtests/blenlib/BLI_polyfill_2d_test.cc b/tests/gtests/blenlib/BLI_polyfill_2d_test.cc
index 5566dced798..264ed8fadbc 100644
--- a/tests/gtests/blenlib/BLI_polyfill_2d_test.cc
+++ b/tests/gtests/blenlib/BLI_polyfill_2d_test.cc
@@ -9,13 +9,14 @@
#define USE_COMBINATIONS_ALL
#define USE_BEAUTIFY
+#include "MEM_guardedalloc.h"
+
extern "C" {
#include "BLI_utildefines.h"
#include "BLI_array_utils.h"
#include "BLI_polyfill_2d.h"
#include "BLI_edgehash.h"
#include "BLI_math.h"
-#include "MEM_guardedalloc.h"
#ifdef USE_OBJ_PREVIEW
# include "BLI_string.h"
diff --git a/tests/gtests/blenlib/BLI_task_performance_test.cc b/tests/gtests/blenlib/BLI_task_performance_test.cc
index 84b7b8b6439..c5af75f1eb2 100644
--- a/tests/gtests/blenlib/BLI_task_performance_test.cc
+++ b/tests/gtests/blenlib/BLI_task_performance_test.cc
@@ -7,6 +7,8 @@
#define GHASH_INTERNAL_API
+#include "MEM_guardedalloc.h"
+
extern "C" {
#include "BLI_utildefines.h"
@@ -15,8 +17,6 @@ extern "C" {
#include "BLI_task.h"
#include "PIL_time.h"
-
-#include "MEM_guardedalloc.h"
}
#define NUM_RUN_AVERAGED 100
diff --git a/tests/gtests/blenlib/BLI_task_test.cc b/tests/gtests/blenlib/BLI_task_test.cc
index a682e8aedf6..d4ab9de13c4 100644
--- a/tests/gtests/blenlib/BLI_task_test.cc
+++ b/tests/gtests/blenlib/BLI_task_test.cc
@@ -5,14 +5,14 @@
#include "atomic_ops.h"
+#include "MEM_guardedalloc.h"
+
extern "C" {
#include "BLI_utildefines.h"
#include "BLI_listbase.h"
#include "BLI_mempool.h"
#include "BLI_task.h"
-
-#include "MEM_guardedalloc.h"
};
#define NUM_ITEMS 10000
diff --git a/tests/gtests/blenloader/blendfile_loading_base_test.cc b/tests/gtests/blenloader/blendfile_loading_base_test.cc
index 7af3293d706..c4e873c255f 100644
--- a/tests/gtests/blenloader/blendfile_loading_base_test.cc
+++ b/tests/gtests/blenloader/blendfile_loading_base_test.cc
@@ -17,6 +17,8 @@
*/
#include "blendfile_loading_base_test.h"
+#include "MEM_guardedalloc.h"
+
extern "C" {
#include "BKE_appdir.h"
#include "BKE_blender.h"
@@ -41,8 +43,6 @@ extern "C" {
#include "IMB_imbuf.h"
-#include "MEM_guardedalloc.h"
-
#include "RNA_define.h"
#include "WM_api.h"