mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
[svn] Use strtoll on Windows if available (as with DMC).
This commit is contained in:
parent
0272acfc52
commit
f65cee77a8
@ -1,3 +1,7 @@
|
||||
2005-07-06 Hrvoje Niksic <hniksic@xemacs.org>
|
||||
|
||||
* mswindows.h: Use strtoll where available.
|
||||
|
||||
2005-07-06 Hrvoje Niksic <hniksic@xemacs.org>
|
||||
|
||||
* sysdep.h: Add a full declaration of fnmatch.h.
|
||||
|
@ -72,7 +72,7 @@ xsleep (double seconds)
|
||||
#endif /* not HAVE_USLEEP */
|
||||
}
|
||||
|
||||
#if defined(__BORLANDC__) || (defined(_MSC_VER) && _MSC_VER < 1300)
|
||||
#if !defined(HAVE_STRTOLL) && !defined(HAVE__STRTOI64)
|
||||
|
||||
static inline int
|
||||
char_value (char c, int base)
|
||||
@ -180,20 +180,7 @@ str_to_int64 (const char *nptr, char **endptr, int base)
|
||||
*endptr = (char *) nptr;
|
||||
return result;
|
||||
}
|
||||
|
||||
#else /* !defined(__BORLANDC__) && (!defined(_MSC_VER) || _MSC_VER >= 1300) */
|
||||
|
||||
__int64
|
||||
str_to_int64 (const char *nptr, char **endptr, int base)
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
return _strtoi64 (nptr, endptr, base);
|
||||
#else
|
||||
return strtoll (nptr, endptr, base);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* !defined(__BORLANDC__) && (!defined(_MSC_VER) || _MSC_VER >= 1300) */
|
||||
|
||||
void
|
||||
windows_main (int *argc, char **argv, char **exec_name)
|
||||
|
@ -84,11 +84,15 @@ typedef __int64 wgint;
|
||||
#define WGINT_MAX LL (9223372036854775807)
|
||||
|
||||
/* str_to_wgint is a function with the semantics of strtol, but which
|
||||
works on wgint. Since wgint is unconditionally 64-bit on Windows,
|
||||
we #define it to str_to_int64, which either calls _strtoi64 or
|
||||
implements the conversion manually. */
|
||||
#define str_to_wgint str_to_int64
|
||||
works on wgint. */
|
||||
#if defined HAVE_STRTOLL
|
||||
# define str_to_wgint strtoll
|
||||
#elif defined HAVE__STRTOI64
|
||||
# define str_to_wgint _strtoi64
|
||||
#else
|
||||
__int64 str_to_int64 (const char *, char **, int);
|
||||
# define str_to_wgint str_to_int64
|
||||
#endif
|
||||
|
||||
/* Windows has no symlink, therefore no lstat. Without symlinks lstat
|
||||
is equivalent to stat anyway. */
|
||||
|
@ -95,6 +95,10 @@ so, delete this exception statement from your version. */
|
||||
#define struct_fstat struct _stati64
|
||||
|
||||
#define isatty _isatty
|
||||
|
||||
#if _MSC_VER >= 1300
|
||||
# define HAVE__STRTOI64
|
||||
#endif
|
||||
|
||||
/* ------------------ */
|
||||
/* Borland C section. */
|
||||
@ -126,6 +130,7 @@ so, delete this exception statement from your version. */
|
||||
#define HAVE__BOOL 1
|
||||
#undef SIZEOF_LONG_LONG
|
||||
#define SIZEOF_LONG_LONG 8
|
||||
#define HAVE_STRTOLL
|
||||
|
||||
#else
|
||||
# error Your compiler is not supported.
|
||||
|
Loading…
Reference in New Issue
Block a user