[Ffmpeg-devel] [PATCH] Missing "inttypes.h" on windows

Diego Biurrun diego
Sat Dec 10 13:58:40 CET 2005

On Sat, Dec 10, 2005 at 09:55:47AM +0100, Alexander Strasser wrote:
> Diego Biurrun wrote:
> > On Sun, Nov 06, 2005 at 07:43:12PM +0100, Fredrik Orderud wrote:
> > > Neither the Microsoft windows platform SDK nor Visual Studio ships with the 
> > > "inttypes.h" header. This leads to compile errors when using ffmpeg DLLs in 
> > > in visual-studio projects, unless EMULATE_INTTYPES is defined.
> > > 
> > > I propose automatically defining EMULATE_INTTYPES in "libavutil/common.h" 
> > > for all windows-systems, except cygwin and mingw. This would simplify usage 
> > > of ffmpeg libraries on windows computers.
> > 
> > ./configure should detect your lack of inttypes.h and EMULATE_INTTYPES
> > should be #defined in config.h.  Have you tried #including config.h in
> > libavutil/common.h?
>   No, he is using the DLLs/headers in a Visual Studio Project, so he is
> on it's own basically. The time he configured inttypes.h was available
> in mingw environment.
>   And if he would continue using mingw/msys as build environment and gcc
> as compiler he would still have inttypes.h.

We're completely misunderstanding each other, let me clarify ..

./configure runs the following test:

# *inttypes.h* test
cat > $TMPC << EOF
#include <inttypes.h>
int main(int argc, char ** argv){
    return 0;

$cc -o $TMPE $TMPC 2>/dev/null || inttypes="no"

which I would expect to set inttypes to "no" on a MSVC system so that
later on

if test "$inttypes" != "yes" ; then
  echo "#define EMULATE_INTTYPES 1" >> $TMPH

adds "#define EMULATE_INTTYPES 1" to config.h so that adding

#include "config.h"

to the top of libavutil/common.h should solve the problem.

This is untested but would be much more elegant than the patch that was
sent in.  Since I have no Windows, much less MSVC, I would be happy if
somebody could verify this.


More information about the ffmpeg-devel mailing list