[Bf-blender-cvs] [71086995a55] master: Cleanup: Fix build warnings with MSVC.

Ray Molenkamp noreply at git.blender.org
Sat Jun 29 06:54:09 CEST 2019


Commit: 71086995a552d41be361e49e7c3f3cfbfffa4dac
Author: Ray Molenkamp
Date:   Fri Jun 28 22:53:58 2019 -0600
Branches: master
https://developer.blender.org/rB71086995a552d41be361e49e7c3f3cfbfffa4dac

Cleanup: Fix build warnings with MSVC.

ffmpeg defines some of the math constants if they are not
found before including any of its headers, this lead to
a build warnings about M_E, M_LN2 and M_SQRT1_2 being
redefined once BLI_math_base.h gets included.

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

M	source/blender/blenkernel/intern/writeffmpeg.c

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

diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c
index e31e7fb5b63..345d9ce1193 100644
--- a/source/blender/blenkernel/intern/writeffmpeg.c
+++ b/source/blender/blenkernel/intern/writeffmpeg.c
@@ -25,12 +25,6 @@
 
 #  include <stdlib.h>
 
-#  include <libavformat/avformat.h>
-#  include <libavcodec/avcodec.h>
-#  include <libavutil/rational.h>
-#  include <libavutil/samplefmt.h>
-#  include <libswscale/swscale.h>
-
 #  include "MEM_guardedalloc.h"
 
 #  include "DNA_scene_types.h"
@@ -56,6 +50,14 @@
 
 #  include "IMB_imbuf.h"
 
+/* This needs to be included after BLI_math_base.h otherwise it will redefine some math defines
+ * like M_SQRT1_2 leading to warnings with MSVC */
+#  include <libavformat/avformat.h>
+#  include <libavcodec/avcodec.h>
+#  include <libavutil/rational.h>
+#  include <libavutil/samplefmt.h>
+#  include <libswscale/swscale.h>
+
 #  include "ffmpeg_compat.h"
 
 struct StampData;



More information about the Bf-blender-cvs mailing list