Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: pws-18: 64-bit integer support



"Andrej Borsenkow" wrote:
> checking if long is 64 bits... yes
> ./configure: syntax error at line 3371: `zsh_64_BIT_TYPE' unexpected
> 
> zsh_64_BIT_TYPE is not defined anywhere (as far a I can tell)

Something's gone wrong with autoconf:  that should be substituted into
configure.in from aczsh.m4.  It has been in mine.  Oh, but I didn't send
the patch for aczsh.m4.  Here it is.

> [AC_TRY_RUN([int main() { return sizeof(long) < 8; }],
> zsh_cv_long_is_64_bit=yes,
> zsh_cv_long_is_64_bit=no,
> zsh_cv_long_is_64_bit=no)])
> 
> Should it not be "return sizeof(long) >= 8"? Or at least sizeof(long) == 8?

Status 0 is a `yes', so if sizeof(long) < 8 it returns 1.  That makes it
consistent with a failure to compile, which would also give status 1.

--- aczsh.m4.z64_2	Wed May 19 09:37:22 1999
+++ aczsh.m4	Mon May 17 17:57:54 1999
@@ -72,6 +72,39 @@
 ])
 
 dnl
+dnl zsh_64_BIT_TYPE
+dnl   Check whether the first argument works as a 64-bit type.
+dnl   If there is a non-zero second argument, we just assume it works
+dnl   when we're cross compiling.  This is to allow a type to be
+dnl   specified directly as --enable-lfs="long long".
+dnl   Sets zsh_cv_64_bit_type to the first argument if the test worked,
+dnl   `no' otherwise.  Be careful testing this, as it may produce
+dnl   two words `long long' on an unquoted substitution.
+dnl   This macro does not produce messages as it may be run several times
+dnl   before finding the right type.
+dnl
+
+AC_DEFUN(zsh_64_BIT_TYPE,
+[AC_TRY_RUN([
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+main()
+{
+  $1 foo = 0; 
+  return sizeof($1) != 8;
+}
+], zsh_cv_64_bit_type="$1", zsh_cv_64_bit_type=no,
+  [if test x$2 != x ; then
+    zsh_cv_64_bit_type="$1"
+  else
+    zsh_cv_64_bit_type=no
+  fi])
+])
+
+
+dnl
 dnl zsh_SYS_DYNAMIC_BROKEN
 dnl   Check whether static/shared library linking is broken.
 dnl

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxx>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy



Messages sorted by: Reverse Date, Date, Thread, Author