[perl-Glib] Try to fix the 64bit converters for mingw32
- From: Torsten Schönfeld <tsch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [perl-Glib] Try to fix the 64bit converters for mingw32
- Date: Mon, 8 Nov 2010 22:51:05 +0000 (UTC)
commit 7e7342275cf68cd4438cb98214eecbb21e0e0d9d
Author: Torsten Schönfeld <kaffeetisch gmx de>
Date: Sun Oct 31 01:47:13 2010 +0200
Try to fix the 64bit converters for mingw32
If we're not being compiled with the Microsoft compiler, just use
strtoll and strtoull everywhere.
https://bugzilla.gnome.org/show_bug.cgi?id=626902
GType.xs | 50 +++++++++++++-------------------------------------
1 files changed, 13 insertions(+), 37 deletions(-)
---
diff --git a/GType.xs b/GType.xs
index 3b4c5d2..92332ed 100644
--- a/GType.xs
+++ b/GType.xs
@@ -767,28 +767,18 @@ C<SvIV> instead.
#if GLIB_CHECK_VERSION (2, 12, 0)
# define PORTABLE_STRTOLL(str, end, base) g_ascii_strtoll (str, end, base)
-#else
-# ifdef WIN32
-# ifdef _MSC_VER
-# if (_MSC_VER >= 1300)
-# define PORTABLE_STRTOLL(str, end, base) _strtoi64 (str, end, base)
-# else
-# define PORTABLE_STRTOLL(str, end, base) _atoi64 (str)
-# endif
-# else
-# define PORTABLE_STRTOLL(str, end, base) strtol (str, end, base)
-# endif
+#elif defined(_MSC_VER)
+# if _MSC_VER >= 1300
+# define PORTABLE_STRTOLL(str, end, base) _strtoi64 (str, end, base)
# else
-# define PORTABLE_STRTOLL(str, end, base) strtoll (str, end, base)
+# define PORTABLE_STRTOLL(str, end, base) _atoi64 (str)
# endif
+#else
+# define PORTABLE_STRTOLL(str, end, base) strtoll (str, end, base)
#endif
-#ifdef WIN32
-# if defined(_MSC_VER) || defined(__MSVCRT__)
-# define PORTABLE_LL_FORMAT "%I64d"
-# else
-# define PORTABLE_LL_FORMAT "%ld"
-# endif
+#if defined(_MSC_VER) || defined(__MSVCRT__)
+# define PORTABLE_LL_FORMAT "%I64d"
#else
# define PORTABLE_LL_FORMAT "%lld"
#endif
@@ -838,28 +828,14 @@ uses C<SvUV> instead.
#if GLIB_CHECK_VERSION (2, 2, 0)
# define PORTABLE_STRTOULL(str, end, base) g_ascii_strtoull (str, end, base)
+#elif defined(_MSC_VER) && _MSC_VER >= 1300
+# define PORTABLE_STRTOULL(str, end, base) _strtoui64 (str, end, base)
#else
-# ifdef WIN32
-# ifdef _MSC_VER
-# if (_MSC_VER >= 1300)
-# define PORTABLE_STRTOULL(str, end, base) _strtoui64 (str, end, base)
-# else
-# define PORTABLE_STRTOULL(str, end, base) strtoul (str, end, base)
-# endif
-# else
-# define PORTABLE_STRTOULL(str, end, base) strtoul (str, end, base)
-# endif
-# else
-# define PORTABLE_STRTOULL(str, end, base) strtoull (str, end, base)
-# endif
+# define PORTABLE_STRTOULL(str, end, base) strtoull (str, end, base)
#endif
-#ifdef WIN32
-# if defined(_MSC_VER) || defined(__MSVCRT__)
-# define PORTABLE_ULL_FORMAT "%I64u"
-# else
-# define PORTABLE_ULL_FORMAT "%lu"
-# endif
+#if defined(_MSC_VER) || defined(__MSVCRT__)
+# define PORTABLE_ULL_FORMAT "%I64u"
#else
# define PORTABLE_ULL_FORMAT "%llu"
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]