[Ffmpeg-devel] stdint.h and inttypes.h for non-C99 compilers

Steve Lhomme steve.lhomme
Tue Dec 12 16:13:12 CET 2006

Ramiro Polla wrote:
> 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

Indeed, I didn't know if VC6 would like __intxx and especially the 
__int64 one but it seems to be fine. Here is the modified version. It 
also avoids some warning with SDL which uses __intxx with _MSC_VER.

BTW why not make the license of the file public domain ? Or BSD/MIT ?

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: stdint.h
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20061212/052e5601/attachment.txt>

More information about the ffmpeg-devel mailing list