+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.
#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)
*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)
#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. */
#define struct_fstat struct _stati64
#define isatty _isatty
+
+#if _MSC_VER >= 1300
+# define HAVE__STRTOI64
+#endif
\f
/* ------------------ */
/* Borland C section. */
#define HAVE__BOOL 1
#undef SIZEOF_LONG_LONG
#define SIZEOF_LONG_LONG 8
+#define HAVE_STRTOLL
\f
#else
# error Your compiler is not supported.