Add support for missing strtoll and strtoull on Windows 32/64
This commit is contained in:
parent
aea2b53123
commit
40f01478d8
2 changed files with 14 additions and 5 deletions
7
tcc.h
7
tcc.h
|
@ -65,12 +65,11 @@ extern long double strtold (const char *__nptr, char **__endptr);
|
||||||
# ifndef __GNUC__
|
# ifndef __GNUC__
|
||||||
# define strtold (long double)strtod
|
# define strtold (long double)strtod
|
||||||
# define strtof (float)strtod
|
# define strtof (float)strtod
|
||||||
# ifdef _WIN64
|
# ifndef strtoll
|
||||||
# define strtoll _strtoi64
|
# define strtoll _strtoi64
|
||||||
|
# endif
|
||||||
|
# ifndef strtoull
|
||||||
# define strtoull _strtoui64
|
# define strtoull _strtoui64
|
||||||
# else
|
|
||||||
# define strtoll strtol
|
|
||||||
# define strtoull strtoul
|
|
||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
# ifdef LIBTCC_AS_DLL
|
# ifdef LIBTCC_AS_DLL
|
||||||
|
|
|
@ -536,7 +536,7 @@ extern "C" {
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined __NO_ISOCEXT /* externs in static libmingwex.a */
|
#if !defined __NO_ISOCEXT
|
||||||
|
|
||||||
typedef struct { long long quot, rem; } lldiv_t;
|
typedef struct { long long quot, rem; } lldiv_t;
|
||||||
|
|
||||||
|
@ -544,8 +544,18 @@ extern "C" {
|
||||||
|
|
||||||
__CRT_INLINE long long __cdecl llabs(long long _j) { return (_j >= 0 ? _j : -_j); }
|
__CRT_INLINE long long __cdecl llabs(long long _j) { return (_j >= 0 ? _j : -_j); }
|
||||||
|
|
||||||
|
/* stro[u]ll do not properly map in Windows; use macros as VC++ does */
|
||||||
|
#if !defined(strtoll)
|
||||||
|
#define strtoll _strtoi64
|
||||||
|
#endif
|
||||||
|
#if !defined(strtoull)
|
||||||
|
#define strtoull _strtoui64
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
long long __cdecl strtoll(const char* __restrict__, char** __restrict, int);
|
long long __cdecl strtoll(const char* __restrict__, char** __restrict, int);
|
||||||
unsigned long long __cdecl strtoull(const char* __restrict__, char** __restrict__, int);
|
unsigned long long __cdecl strtoull(const char* __restrict__, char** __restrict__, int);
|
||||||
|
*/
|
||||||
|
|
||||||
/* these are stubs for MS _i64 versions */
|
/* these are stubs for MS _i64 versions */
|
||||||
long long __cdecl atoll (const char *);
|
long long __cdecl atoll (const char *);
|
||||||
|
|
Loading…
Add table
Reference in a new issue