Compilation with g++ broken, was Re: [Ffmpeg-devel] [PATCH] avcodec.h should include stdint.h

Måns Rullgård mans
Fri Mar 9 16:22:24 CET 2007


Ismail D?nmez said:
> On Friday 09 March 2007 17:09:19 M?ns Rullg?rd wrote:
>> Ismail D?nmez said:
>> > On Friday 09 March 2007 16:43:29 Diego Biurrun wrote:
>> >> On Fri, Mar 09, 2007 at 04:33:29PM +0200, Ismail D??nmez wrote:
>> >> > avcodec.h uses INT64_C macro but not include stdint.h, either it
>> >> > shouldn't use that macro or should include stdint.h . Attached patch
>> >> > does the latter.
>> >>
>> >> It includes inttypes.h via avutil.h and common.h.  Supposedly inttypes.h
>> >> includes stdint.h, it does on my glibc system ...
>> >
>> > Ok looks like only g++ is effected:
>> >
>> > [~]> cat test.cpp
>> > #include <ffmpeg/avformat.h>
>> > #include <ffmpeg/avcodec.h>
>> >
>> > main() {
>> > }
>> >
>> > [~]> g++ -c test.cpp
>> > In file included from test.cpp:2:
>> > /usr/include/ffmpeg/avformat.h: In function 'void
>> > av_init_packet(AVPacket*)': /usr/include/ffmpeg/avformat.h:66: error:
>> > 'INT64_C' was not declared in this scope
>> >
>> > Ideas?
>>
>> In C++ you need to define some macro before including stdint.h to get some
>> of the things is provides, this macro among them.  I forget the details,
>> but IIRC it has been mentioned on this list previously.
>
> -D__STDC_CONSTANT_MACROS is needed thanks, but I think this is a regression
> without bumping .so number. I hit this in while compiling k3b.

It's no regression.  There is no change when then headers are used in a C
environment.  Previously, it happened to work in some C++ compilers too,
but only by accident.  Either way, the ABI hasn't changed, so the dynamic
library version should stay the same.

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list