History

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

Christian Jullien committed 4 years ago

Commit 40f01471 parent aea2b532 files · +14 −5Browse files

Unified · Split

2 files
  1. tcc.h +3 −4
  2. win32/include/stdlib.h +11 −1
tcc.h+3−4
@@ -65,12 +65,11 @@ extern long double strtold (const char *__nptr, char **__endptr); · 64 unmodified lines
6565 # ifndef __GNUC__
6666 # define strtold (long double)strtod
6767 # define strtof (float)strtod
68−# ifdef _WIN64
68+# ifndef strtoll
6969 # define strtoll _strtoi64
70+# endif
71+# ifndef strtoull
7072 # define strtoull _strtoui64
71−# else
72−# define strtoll strtol
73−# define strtoull strtoul
7473 # endif
7574 # endif
7675 # ifdef LIBTCC_AS_DLL
win32/include/stdlib.h+11−1
@@ -536,7 +536,7 @@ extern "C" { · 535 unmodified lines
536536 #endif
537537 #endif
538538
539−#if !defined __NO_ISOCEXT /* externs in static libmingwex.a */
539+#if !defined __NO_ISOCEXT
540540
541541 typedef struct { long long quot, rem; } lldiv_t;
542542
@@ -544,8 +544,18 @@ extern "C" { · 1 unmodified line
544544
545545 __CRT_INLINE long long __cdecl llabs(long long _j) { return (_j >= 0 ? _j : -_j); }
546546
547+ /* stro[u]ll do not properly map in Windows; use macros as VC++ does */
548+ #if !defined(strtoll)
549+ #define strtoll _strtoi64
550+ #endif
551+ #if !defined(strtoull)
552+ #define strtoull _strtoui64
553+ #endif
554+
555+/*
547556 long long __cdecl strtoll(const char* __restrict__, char** __restrict, int);
548557 unsigned long long __cdecl strtoull(const char* __restrict__, char** __restrict__, int);
558+*/
549559
550560 /* these are stubs for MS _i64 versions */
551561 long long __cdecl atoll (const char *);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t