[Ffmpeg-devel] stdint.h and inttypes.h for non-C99 compilers
Ramiro Polla
angustia
Tue Dec 12 15:55:18 CET 2006
Steve Lhomme wrote:
> Steve Lhomme wrote:
>> Alexander Chemeris wrote:
>>> Hello,
>>>
>>> I wrote inttypes.h and stdint.h that should conform to C99 Standard.
>>> They depends on internal Visual Studio headers, thus does not portable
>>> to any other compilers. But for Visual Studio they work well. Check
>>> them
>>> here:
>>> http://msinttypes.googlecode.com/svn/trunk/stdint.h
>>> http://msinttypes.googlecode.com/svn/trunk/inttypes.h
>>> Any constructive notes on this implementation are welcome.
>>>
>>> Also I found portable version of stdint.h on the net:
>>> http://www.azillionmonkeys.com/qed/pstdint.h
>>> However it does not implement inttypes.h.
>>>
>>> Please, add this links to FAQ, may be under Windows section.
>>
>> When using it with VC++ Express I get the following warning:
>> adler32.c
>> c:\Perso\Programmes\DivX\DrDivXOSS\work\drffmpeg\platform\msvc\stdint.h(154)
>> : warning C4005: 'SIZE_MAX' : macro redefinition
>> C:\Program Files\Program\Microsoft Visual Studio
>> 8\VC\include\limits.h(92) : see previous definition of 'SIZE_MAX'
>>
>> And also:
>> allcodecs.c
>> C:\Program Files\Program\Microsoft Visual Studio
>> 8\VC\include\wchar.h(44) : warning C4005: 'WCHAR_MAX' : macro
>> redefinition
>>
>> c:\Perso\Programmes\DivX\DrDivXOSS\work\drffmpeg\platform\msvc\stdint.h(162)
>> : see previous definition of 'WCHAR_MAX'
>>
>> They can be fixed with #ifndef SIZE_MAX and #ifndef WCHAR_MAX
>
> OK scrap that. Noone's going to modify MS headers. But it happens
> because you assume wchar.h is included which is not the case. So the
> solution is to include wchar.h in your file.
>
>> I'll give it a try in VC6 too.
>
> Much worse. It doesn't know INT8, INT16, UINT8, UINT16, int8_t,
> int16_t, uint8_t, uint16_t. So I think it's better to use char and
> short for these.
>
Maybe not caring about U?INT* would be best. I prefer using __intxx.
like in http://arrozcru.no-ip.org/ffmpeg_wiki/tiki-index.php?page=inttypes.h
Ramiro Polla
More information about the ffmpeg-devel
mailing list