mirror of
https://github.com/claunia/flac.git
synced 2025-12-16 18:54:26 +00:00
replace local_strtoull with _strtoui64 in windows
Previous patch replaced the other local_strtoll with _strtoi64
This commit is contained in:
committed by
Erik de Castro Lopo
parent
7e62afe9fa
commit
c2417da842
@@ -61,6 +61,7 @@
|
|||||||
|
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
#define strtoll _strtoi64
|
#define strtoll _strtoi64
|
||||||
|
#define strtoull _strtoui64
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "FLAC/assert.h"
|
#include "FLAC/assert.h"
|
||||||
#include "share/alloc.h"
|
#include "share/alloc.h"
|
||||||
|
#include "share/compat.h"
|
||||||
#include "share/grabbag/replaygain.h"
|
#include "share/grabbag/replaygain.h"
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -840,34 +841,12 @@ FLAC__bool parse_uint32(const char *src, FLAC__uint32 *dest)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
/* There's no strtoull() in MSVC6 so we just write a specialized one */
|
|
||||||
static FLAC__uint64 local__strtoull(const char *src)
|
|
||||||
{
|
|
||||||
FLAC__uint64 ret = 0;
|
|
||||||
int c;
|
|
||||||
FLAC__ASSERT(0 != src);
|
|
||||||
while(0 != (c = *src++)) {
|
|
||||||
c -= '0';
|
|
||||||
if(c >= 0 && c <= 9)
|
|
||||||
ret = (ret * 10) + c;
|
|
||||||
else
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
FLAC__bool parse_uint64(const char *src, FLAC__uint64 *dest)
|
FLAC__bool parse_uint64(const char *src, FLAC__uint64 *dest)
|
||||||
{
|
{
|
||||||
FLAC__ASSERT(0 != src);
|
FLAC__ASSERT(0 != src);
|
||||||
if(strlen(src) == 0 || strspn(src, "0123456789") != strlen(src))
|
if(strlen(src) == 0 || strspn(src, "0123456789") != strlen(src))
|
||||||
return false;
|
return false;
|
||||||
#ifdef _MSC_VER
|
|
||||||
*dest = local__strtoull(src);
|
|
||||||
#else
|
|
||||||
*dest = strtoull(src, 0, 10);
|
*dest = strtoull(src, 0, 10);
|
||||||
#endif
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user