about summary refs log tree commit diff
path: root/Src/zsh.h
diff options
context:
space:
mode:
authorManuel Presnitz <mpy@gmx.net>2014-02-19 14:12:03 +0100
committerPeter Stephenson <p.w.stephenson@ntlworld.com>2014-03-01 19:08:17 +0000
commit973e5dc37d27cf5c39f33b0ff8839b167004bf3f (patch)
treeb570ea6986e73a3693f30b68bae36ff63df1f1f3 /Src/zsh.h
parentf798f13b0eba1f31cd2d760441ac9d36a6ac5263 (diff)
downloadzsh-973e5dc37d27cf5c39f33b0ff8839b167004bf3f.tar.gz
zsh-973e5dc37d27cf5c39f33b0ff8839b167004bf3f.tar.xz
zsh-973e5dc37d27cf5c39f33b0ff8839b167004bf3f.zip
32412 / 32415: New giga- and terabyte units for glob qualifiers
Diffstat (limited to 'Src/zsh.h')
-rw-r--r--Src/zsh.h29
1 files changed, 26 insertions, 3 deletions
diff --git a/Src/zsh.h b/Src/zsh.h
index c86d2a62c..5fbff5767 100644
--- a/Src/zsh.h
+++ b/Src/zsh.h
@@ -33,9 +33,6 @@
 /*
  * Our longest integer type:  will be a 64 bit either if long already is,
  * or if we found some alternative such as long long.
- * Currently we only define this to be longer than a long if
- * --enable-largefile * was given.  That enables internal use of 64-bit
- * types even if no actual large file support is present.
  */
 #ifdef ZSH_64_BIT_TYPE
 typedef ZSH_64_BIT_TYPE zlong;
@@ -50,6 +47,32 @@ typedef unsigned long zulong;
 #endif
 
 /*
+ * Work out how to define large integer constants that will fit
+ * in a zlong.
+ */
+#if defined(ZSH_64_BIT_TYPE) || defined(LONG_IS_64_BIT)
+/* We have some 64-bit type */
+#ifdef LONG_IS_64_BIT
+/* It's long */
+#define ZLONG_CONST(x)  x ## l
+#else
+/* It's long long */
+#ifdef ZLONG_IS_LONG_LONG
+#define ZLONG_CONST(x)  x ## ll
+#else
+/*
+ * There's some 64-bit type, but we don't know what it is.
+ * We'll just cast it and hope the compiler does the right thing.
+ */
+#define ZLONG_CONST(x) ((zlong)x)
+#endif
+#endif
+#else
+/* We're stuck with long */
+#define ZLONG_CONST(x) (x ## l)
+#endif
+
+/*
  * Double float support requires 64-bit alignment, so if longs and
  * pointers are less we need to pad out.
  */