[Bf-blender-cvs] [b9af4d4] depsgraph_refactor: Fix for compiler error with mingw64 about inlining functions with variadic args

Joshua Leung noreply at git.blender.org
Tue Jan 6 13:10:29 CET 2015


Commit: b9af4d470339c1d59bf01f08464fc86af34dba8b
Author: Joshua Leung
Date:   Wed Jan 7 01:09:11 2015 +1300
Branches: depsgraph_refactor
https://developer.blender.org/rBb9af4d470339c1d59bf01f08464fc86af34dba8b

Fix for compiler error with mingw64 about inlining functions with variadic args

Patch by Sergey

===================================================================

M	source/blender/depsgraph/intern/depsgraph_build.cpp
M	source/blender/depsgraph/intern/depsgraph_debug.h
M	source/blender/depsgraph/intern/depsgraph_tag.cpp
M	source/blender/depsgraph/intern/depsgraph_type_defines.cpp

===================================================================

diff --git a/source/blender/depsgraph/intern/depsgraph_build.cpp b/source/blender/depsgraph/intern/depsgraph_build.cpp
index e1c9ae4..7580f0c 100644
--- a/source/blender/depsgraph/intern/depsgraph_build.cpp
+++ b/source/blender/depsgraph/intern/depsgraph_build.cpp
@@ -330,7 +330,7 @@ void DepsgraphRelationBuilder::add_time_relation(TimeSourceDepsNode *timesrc, De
 		m_graph->add_new_relation(timesrc, node_to, DEPSREL_TYPE_TIME, description);
 	}
 	else {
-		deg_debug_printf("add_time_relation(%p = %s, %p = %s, %s) Failed\n",
+		DEG_DEBUG_PRINTF("add_time_relation(%p = %s, %p = %s, %s) Failed\n",
 		                 timesrc,   (timesrc) ? timesrc->identifier().c_str() : "<None>",
 		                 node_to,   (node_to) ? node_to->identifier().c_str() : "<None>",
 		                 description.c_str());
@@ -344,7 +344,7 @@ void DepsgraphRelationBuilder::add_operation_relation(OperationDepsNode *node_fr
 		m_graph->add_new_relation(node_from, node_to, type, description);
 	}
 	else {
-		deg_debug_printf("add_operation_relation(%p = %s, %p = %s, %d, %s) Failed\n",
+		DEG_DEBUG_PRINTF("add_operation_relation(%p = %s, %p = %s, %d, %s) Failed\n",
 		                 node_from, (node_from) ? node_from->identifier().c_str() : "<None>",
 		                 node_to,   (node_to)   ? node_to->identifier().c_str() : "<None>",
 		                 type, description.c_str());
diff --git a/source/blender/depsgraph/intern/depsgraph_debug.h b/source/blender/depsgraph/intern/depsgraph_debug.h
index 6fccc94..8b54209 100644
--- a/source/blender/depsgraph/intern/depsgraph_debug.h
+++ b/source/blender/depsgraph/intern/depsgraph_debug.h
@@ -75,14 +75,11 @@ struct DepsgraphDebug {
 	}
 };
 
-BLI_INLINE void deg_debug_printf(const char *format, ...)
-{
-	if (G.debug & G_DEBUG_DEPSGRAPH) {
-		va_list args;
-		va_start(args, format);
-		vfprintf(stdout, format, args);
-		va_end(args);
-	}
-}
+#define DEG_DEBUG_PRINTF(...) \
+	{ \
+		if (G.debug & G_DEBUG_DEPSGRAPH) { \
+			fprintf(stderr, __VA_ARGS__); \
+		} \
+	} \
 
 #endif  /* __DEPSGRAPH_DEBUG_H__ */
diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cpp b/source/blender/depsgraph/intern/depsgraph_tag.cpp
index e9d41bf..1b21be6 100644
--- a/source/blender/depsgraph/intern/depsgraph_tag.cpp
+++ b/source/blender/depsgraph/intern/depsgraph_tag.cpp
@@ -143,7 +143,7 @@ void DEG_id_tag_update(ID *id, short flag)
 
 void DEG_id_tag_update_ex(Main *bmain, ID *id, short flag)
 {
-	deg_debug_printf("%s: id=%s flag=%d\n", id->name, flag);
+	DEG_DEBUG_PRINTF("%s: id=%s flag=%d\n", id->name, flag);
 	lib_id_recalc_tag_flag(bmain, id, flag);
 	for (Scene *scene = (Scene *)bmain->scene.first;
 	     scene != NULL;
diff --git a/source/blender/depsgraph/intern/depsgraph_type_defines.cpp b/source/blender/depsgraph/intern/depsgraph_type_defines.cpp
index 26a0bef..4dc03c2 100644
--- a/source/blender/depsgraph/intern/depsgraph_type_defines.cpp
+++ b/source/blender/depsgraph/intern/depsgraph_type_defines.cpp
@@ -78,7 +78,7 @@ void BKE_animsys_eval_animdata(EvaluationContext *UNUSED(eval_ctx),
                              ID *id,
                              TimeSourceDepsNode *time_src)
 {
-	deg_debug_printf("%s on %s\n", __func__, id->name);
+	DEG_DEBUG_PRINTF("%s on %s\n", __func__, id->name);
 	AnimData *adt = BKE_animdata_from_id(id);
 	Scene *scene = NULL; // XXX: this is only needed for flushing RNA updates, which should get handled as part of the graph instead...
 	float ctime = time_src->cfra;
@@ -91,7 +91,7 @@ void BKE_animsys_eval_driver(EvaluationContext *UNUSED(eval_ctx),
                              TimeSourceDepsNode *time_src)
 {
 	/* TODO(sergey): De-duplicate with BKE animsys. */
-	deg_debug_printf("%s on %s (%s[%d])\n",
+	DEG_DEBUG_PRINTF("%s on %s (%s[%d])\n",
 	                 __func__,
 	                 id->name,
 	                 fcu->rna_path,
@@ -134,7 +134,7 @@ void BKE_pose_eval_init(EvaluationContext *eval_ctx,
                         Object *ob,
                         bPose *pose)
 {
-	deg_debug_printf("%s on %s\n", __func__, ob->id.name);
+	DEG_DEBUG_PRINTF("%s on %s\n", __func__, ob->id.name);
 	BLI_assert(ob->type == OB_ARMATURE);
 	float ctime = BKE_scene_frame_get(scene); /* not accurate... */
 
@@ -165,7 +165,7 @@ void BKE_pose_eval_bone(EvaluationContext *eval_ctx,
                         Object *ob,
                         bPoseChannel *pchan) 
 {
-	deg_debug_printf("%s on %s pchan %s\n", __func__, ob->id.name, pchan->name);
+	DEG_DEBUG_PRINTF("%s on %s pchan %s\n", __func__, ob->id.name, pchan->name);
 	bArmature *arm = (bArmature *)ob->data;
 	BLI_assert(ob->type == OB_ARMATURE);
 	if (arm->edbo || (arm->flag & ARM_RESTPOS)) {
@@ -197,7 +197,7 @@ void BKE_pose_constraints_evaluate(EvaluationContext *eval_ctx,
                                    Object *ob,
                                    bPoseChannel *pchan)
 {
-	deg_debug_printf("%s on %s pchan %s\n", __func__, ob->id.name, pchan->name);
+	DEG_DEBUG_PRINTF("%s on %s pchan %s\n", __func__, ob->id.name, pchan->name);
 	Scene *scene = (Scene*)G.main->scene.first;
 	float ctime = BKE_scene_frame_get(scene); /* not accurate... */
 
@@ -214,7 +214,7 @@ void BKE_pose_iktree_evaluate(EvaluationContext *eval_ctx,
                               Object *ob,
                               bPoseChannel *rootchan)
 {
-	deg_debug_printf("%s on %s pchan %s\n", __func__, ob->id.name, rootchan->name);
+	DEG_DEBUG_PRINTF("%s on %s pchan %s\n", __func__, ob->id.name, rootchan->name);
 	float ctime = BKE_scene_frame_get(scene); /* not accurate... */
 	BIK_execute_tree(scene, ob, rootchan, ctime);
 }
@@ -224,7 +224,7 @@ void BKE_pose_splineik_evaluate(EvaluationContext *eval_ctx,
                                 Object *ob,
                                 bPoseChannel *rootchan)
 {
-	deg_debug_printf("%s on %s pchan %s\n", __func__, ob->id.name, rootchan->name);
+	DEG_DEBUG_PRINTF("%s on %s pchan %s\n", __func__, ob->id.name, rootchan->name);
 	float ctime = BKE_scene_frame_get(scene); /* not accurate... */
 	BKE_splineik_execute_tree(scene, ob, rootchan, ctime);
 }
@@ -234,7 +234,7 @@ void BKE_pose_eval_flush(EvaluationContext *eval_ctx,
                          Object *ob,
                          bPose *pose)
 {
-	deg_debug_printf("%s on %s\n", __func__, ob->id.name);
+	DEG_DEBUG_PRINTF("%s on %s\n", __func__, ob->id.name);
 	bPoseChannel *pchan;
 	float imat[4][4];
 	BLI_assert(ob->type == OB_ARMATURE);
@@ -262,7 +262,7 @@ void BKE_rigidbody_eval_simulation(EvaluationContext *eval_ctx, Scene *scene) {}
 
 void BKE_rigidbody_object_sync_transforms(EvaluationContext *eval_ctx, Scene *scene, Object *ob)
 {
-	deg_debug_printf("%s on %s\n", __func__, ob->id.name);
+	DEG_DEBUG_PRINTF("%s on %s\n", __func__, ob->id.name);
 	RigidBodyWorld *rbw = scene->rigidbody_world;
 	float ctime = BKE_scene_frame_get(scene);
 	/* read values pushed into RBO from sim/cache... */




More information about the Bf-blender-cvs mailing list