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
65# ifndef __GNUC__65# ifndef __GNUC__
66# define strtold (long double)strtod66# define strtold (long double)strtod
67# define strtof (float)strtod67# define strtof (float)strtod
68# ifdef _WIN6468# ifndef strtoll
69# define strtoll _strtoi6469# define strtoll _strtoi64
70# endif
71# ifndef strtoull
70# define strtoull _strtoui6472# define strtoull _strtoui64
71# else
72# define strtoll strtol
73# define strtoull strtoul
74# endif73# endif
75# endif74# endif
76# ifdef LIBTCC_AS_DLL75# ifdef LIBTCC_AS_DLL
win32/include/stdlib.h+11−1
@@ -536,7 +536,7 @@ extern "C" { · 535 unmodified lines
536#endif536#endif
537#endif537#endif
538 538
539#if !defined __NO_ISOCEXT /* externs in static libmingwex.a */539#if !defined __NO_ISOCEXT
540 540
541 typedef struct { long long quot, rem; } lldiv_t;541 typedef struct { long long quot, rem; } lldiv_t;
542 542
@@ -544,8 +544,18 @@ extern "C" { · 1 unmodified line
544 544
545 __CRT_INLINE long long __cdecl llabs(long long _j) { return (_j >= 0 ? _j : -_j); }545 __CRT_INLINE long long __cdecl llabs(long long _j) { return (_j >= 0 ? _j : -_j); }
546 546
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/*
547 long long __cdecl strtoll(const char* __restrict__, char** __restrict, int);556 long long __cdecl strtoll(const char* __restrict__, char** __restrict, int);
548 unsigned long long __cdecl strtoull(const char* __restrict__, char** __restrict__, int);557 unsigned long long __cdecl strtoull(const char* __restrict__, char** __restrict__, int);
558*/
549 559
550 /* these are stubs for MS _i64 versions */560 /* these are stubs for MS _i64 versions */
551 long long __cdecl atoll (const char *);561 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