From d33cef6974255810557c7c3086376cdf9fb8bd01 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Sun, 16 May 2010 19:41:49 +0000 Subject: [PATCH] Fix for compilation with newer ffmpeg library Error was cased by undefined UINT64_C in stdint.h for c++ programs. As I understand from ffmpeg mailing list the simpliest solution is to define __STDC_CONSTANT_MACROS before including ffmpeg libraries. There already was some amout of such definitions in the code and I've tested this with newer and older ffmpeg libraries -- this should work and should be safe, but maybe there is better way of fixing this problem. --- intern/audaspace/ffmpeg/AUD_FFMPEGFactory.cpp | 3 +++ intern/audaspace/intern/AUD_C-API.cpp | 6 ++++++ intern/audaspace/intern/AUD_FileFactory.cpp | 3 +++ 3 files changed, 12 insertions(+) diff --git a/intern/audaspace/ffmpeg/AUD_FFMPEGFactory.cpp b/intern/audaspace/ffmpeg/AUD_FFMPEGFactory.cpp index f67c819ff10..8e71c97baec 100644 --- a/intern/audaspace/ffmpeg/AUD_FFMPEGFactory.cpp +++ b/intern/audaspace/ffmpeg/AUD_FFMPEGFactory.cpp @@ -23,6 +23,9 @@ * ***** END LGPL LICENSE BLOCK ***** */ +// needed for INT64_C +#define __STDC_CONSTANT_MACROS + #include "AUD_FFMPEGFactory.h" #include "AUD_FFMPEGReader.h" #include "AUD_Buffer.h" diff --git a/intern/audaspace/intern/AUD_C-API.cpp b/intern/audaspace/intern/AUD_C-API.cpp index 32cfd2098b0..8740f62c9a7 100644 --- a/intern/audaspace/intern/AUD_C-API.cpp +++ b/intern/audaspace/intern/AUD_C-API.cpp @@ -27,6 +27,11 @@ #include #include +#ifdef WITH_FFMPEG +// needed for INT64_C +#define __STDC_CONSTANT_MACROS +#endif + #include "AUD_NULLDevice.h" #include "AUD_I3DDevice.h" #include "AUD_FileFactory.h" @@ -62,6 +67,7 @@ #include "AUD_JackDevice.h" #endif + #ifdef WITH_FFMPEG extern "C" { #include diff --git a/intern/audaspace/intern/AUD_FileFactory.cpp b/intern/audaspace/intern/AUD_FileFactory.cpp index b63390803b1..5888479a0ba 100644 --- a/intern/audaspace/intern/AUD_FileFactory.cpp +++ b/intern/audaspace/intern/AUD_FileFactory.cpp @@ -29,6 +29,9 @@ #include #ifdef WITH_FFMPEG +// needed for INT64_C +#define __STDC_CONSTANT_MACROS + #include "AUD_FFMPEGReader.h" #endif #ifdef WITH_SNDFILE