[FFmpeg-devel] [PATCH] atoll() replacement for WinCE
Martin Storsjö
martin
Wed Jul 15 09:15:58 CEST 2009
On Wed, 15 Jul 2009, Ismail D?nmez wrote:
> WinCE lacks an atoll() implementation. Attached patch adds a very
> basic, no error checking [0] implementation. Is it ok or should I try
> to add a full implementation?
I don't think this is necessary. If you take a look at the mingw32ce
stdlib.h header, you'll find this:
#if defined (__COREDLL__) /* these are stubs for MS _i64 versions */
#if !defined (__STRICT_ANSI__)
__CRT_INLINE long long __cdecl __MINGW_NOTHROW atoll (const char * _c)
{ return _atoi64 (_c); }
#endif
#endif
So __STRICT_ANSI__ seems to be defined (is that an implication of
-std=c99?).
Earlier in the same header file, I found this:
#if defined (__MSVCRT__) /* these are stubs for MS _i64 versions */
long long __cdecl __MINGW_NOTHROW atoll (const char *);
#if !defined (__STRICT_ANSI__)
/* ... some lines removed ... */
/* inline using non-ansi functions */
__CRT_INLINE long long __cdecl __MINGW_NOTHROW atoll (const char * _c)
{ return _atoi64 (_c); }
So if building for MSVCRT (that is, desktop windows), there's a real
function to fall back to, and an inline version using _atoi64 if strict
standard compliance isn't necessary.
Don't know what's the correct way of fixing this though. Making atoll use
_atoi64 regardless of __STRICT_ANSI__, since there's no better
implementation available on the platform?
// Martin
More information about the ffmpeg-devel
mailing list