+/* It is annoying that we have three different syntaxes for 64-bit constants:
+ - nnnL for 64-bit systems, where they are of type long;
+ - nnnLL for 32-bit systems that support long long;
+ - nnnI64 for MS compiler on Windows, which doesn't support long long. */
+
+#if SIZEOF_LONG > 4
+/* If long is large enough, use long constants. */
+# define C10000000000 10000000000L
+# define C100000000000 100000000000L
+# define C1000000000000 1000000000000L
+# define C10000000000000 10000000000000L
+# define C100000000000000 100000000000000L
+# define C1000000000000000 1000000000000000L
+# define C10000000000000000 10000000000000000L
+# define C100000000000000000 100000000000000000L
+# define C1000000000000000000 1000000000000000000L
+#else
+# if SIZEOF_LONG_LONG != 0
+/* Otherwise, if long long is available, use long long constants. */
+# define C10000000000 10000000000LL
+# define C100000000000 100000000000LL
+# define C1000000000000 1000000000000LL
+# define C10000000000000 10000000000000LL
+# define C100000000000000 100000000000000LL
+# define C1000000000000000 1000000000000000LL
+# define C10000000000000000 10000000000000000LL
+# define C100000000000000000 100000000000000000LL
+# define C1000000000000000000 1000000000000000000LL
+# else
+# if defined(_MSC_VER) || defined(__WATCOM__)
+/* Otherwise, if __int64 is available (under Windows), use __int64
+ constants. */
+# define C10000000000 10000000000I64
+# define C100000000000 100000000000I64
+# define C1000000000000 1000000000000I64
+# define C10000000000000 10000000000000I64
+# define C100000000000000 100000000000000I64
+# define C1000000000000000 1000000000000000I64
+# define C10000000000000000 10000000000000000I64
+# define C100000000000000000 100000000000000000I64
+# define C1000000000000000000 1000000000000000000I64
+# endif
+# endif
+#endif
+
+/* SPRINTF_WGINT is used by number_to_string to handle pathological
+ cases and to portably support strange sizes of wgint. */
+#if SIZEOF_LONG >= SIZEOF_WGINT
+# define SPRINTF_WGINT(buf, n) sprintf(buf, "%ld", (long) (n))
+#else
+# if SIZEOF_LONG_LONG >= SIZEOF_WGINT
+# define SPRINTF_WGINT(buf, n) sprintf(buf, "%lld", (long long) (n))
+# else
+# ifdef _MSC_VER
+# define SPRINTF_WGINT(buf, n) sprintf(buf, "%I64", (__int64) (n))
+# endif
+# endif
+#endif
+
+/* Print NUMBER to BUFFER in base 10. This is equivalent to
+ `sprintf(buffer, "%lld", (long long) number)', only much faster and
+ portable to machines without long long.