Add support for missing strtoll and strtoull on Windows 32/64

This commit is contained in:
Christian Jullien 2022-11-11 06:23:26 +01:00
parent aea2b53123
commit 40f01478d8
2 changed files with 14 additions and 5 deletions
tcc.h
win32/include

7
tcc.h
View file

@ -65,12 +65,11 @@ extern long double strtold (const char *__nptr, char **__endptr);
# ifndef __GNUC__
# define strtold (long double)strtod
# define strtof (float)strtod
# ifdef _WIN64
# ifndef strtoll
# define strtoll _strtoi64
# endif
# ifndef strtoull
# define strtoull _strtoui64
# else
# define strtoll strtol
# define strtoull strtoul
# endif
# endif
# ifdef LIBTCC_AS_DLL

View file

@ -536,7 +536,7 @@ extern "C" {
#endif
#endif
#if !defined __NO_ISOCEXT /* externs in static libmingwex.a */
#if !defined __NO_ISOCEXT
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); }
/* 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);
unsigned long long __cdecl strtoull(const char* __restrict__, char** __restrict__, int);
*/
/* these are stubs for MS _i64 versions */
long long __cdecl atoll (const char *);