[Bf-blender-cvs] [cfc8d80] master: ImBuf: Solve re-definition warnings
Sergey Sharybin
noreply at git.blender.org
Sat Feb 20 14:07:19 CET 2016
Commit: cfc8d80f2cee778022359ee2354a523970a06fdf
Author: Sergey Sharybin
Date: Sat Feb 20 11:40:25 2016 +0500
Branches: master
https://developer.blender.org/rBcfc8d80f2cee778022359ee2354a523970a06fdf
ImBuf: Solve re-definition warnings
The idea now is to have FFmpeg/OIIO headers listed after
the system ones. This is because FFmpeg/OIIO might define
some constants with the same name as the ones from math.h.
FFmpeg/OIIO has ifdef around defines, but math.h doesn't
check whether constants were already defined or not, which
causes some noisy warnings.
===================================================================
M source/blender/imbuf/intern/IMB_anim.h
M source/blender/imbuf/intern/anim_movie.c
M source/blender/imbuf/intern/oiio/openimageio_api.cpp
===================================================================
diff --git a/source/blender/imbuf/intern/IMB_anim.h b/source/blender/imbuf/intern/IMB_anim.h
index 537cde9..f476388 100644
--- a/source/blender/imbuf/intern/IMB_anim.h
+++ b/source/blender/imbuf/intern/IMB_anim.h
@@ -72,18 +72,16 @@
# endif /* _WIN32 || __APPLE__ */
#endif /* WITH_QUICKTIME */
-#ifdef WITH_FFMPEG
-# include <libavformat/avformat.h>
-# include <libavcodec/avcodec.h>
-# include <libswscale/swscale.h>
-#endif
-
#include "IMB_imbuf_types.h"
#include "IMB_imbuf.h"
#include "IMB_allocimbuf.h"
-
+#ifdef WITH_FFMPEG
+# include <libavformat/avformat.h>
+# include <libavcodec/avcodec.h>
+# include <libswscale/swscale.h>
+#endif
/* actually hard coded endianness */
#define GET_BIG_LONG(x) (((uchar *) (x))[0] << 24 | ((uchar *) (x))[1] << 16 | ((uchar *) (x))[2] << 8 | ((uchar *) (x))[3])
diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c
index a32cf40..1b4ce42 100644
--- a/source/blender/imbuf/intern/anim_movie.c
+++ b/source/blender/imbuf/intern/anim_movie.c
@@ -85,22 +85,21 @@
#include "IMB_imbuf_types.h"
#include "IMB_imbuf.h"
+#include "IMB_colormanagement.h"
+#include "IMB_colormanagement_intern.h"
+
#include "IMB_anim.h"
#include "IMB_indexer.h"
#ifdef WITH_FFMPEG
-#include <libavformat/avformat.h>
-#include <libavcodec/avcodec.h>
-#include <libavutil/rational.h>
-#include <libswscale/swscale.h>
-
-#include "ffmpeg_compat.h"
+# include <libavformat/avformat.h>
+# include <libavcodec/avcodec.h>
+# include <libavutil/rational.h>
+# include <libswscale/swscale.h>
+# include "ffmpeg_compat.h"
#endif //WITH_FFMPEG
-#include "IMB_colormanagement.h"
-#include "IMB_colormanagement_intern.h"
-
int ismovie(const char *UNUSED(filepath))
{
return 0;
diff --git a/source/blender/imbuf/intern/oiio/openimageio_api.cpp b/source/blender/imbuf/intern/oiio/openimageio_api.cpp
index 0a2e874..b24a89c 100644
--- a/source/blender/imbuf/intern/oiio/openimageio_api.cpp
+++ b/source/blender/imbuf/intern/oiio/openimageio_api.cpp
@@ -31,11 +31,6 @@
#include <set>
-#include <openimageio_api.h>
-#include <OpenImageIO/imageio.h>
-
-OIIO_NAMESPACE_USING
-
#if defined(WIN32) && !defined(FREE_WINDOWS)
#include "utfconv.h"
#endif
@@ -53,6 +48,11 @@ extern "C"
#include "IMB_colormanagement_intern.h"
}
+#include <openimageio_api.h>
+#include <OpenImageIO/imageio.h>
+
+OIIO_NAMESPACE_USING
+
using namespace std;
typedef unsigned char uchar;
More information about the Bf-blender-cvs
mailing list