zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: pws-21: yes, it's a large integer patch
@ 1999-06-10 13:03 Peter Stephenson
  0 siblings, 0 replies; only message in thread
From: Peter Stephenson @ 1999-06-10 13:03 UTC (permalink / raw)
  To: Zsh hackers list

The latest on this saga (from Helmut Jarausch on a go-ahead IRIX system
designed to test system software developers to the limit) seems to be that
some systems sneakily have 64-bit off_t or ino_t and 32-bit longs without
telling you.  In that case, alignment has to be to 64-bits, and also
printing out off_t's and ino_t's in stat.c needs to know about large
integers.  The only sensible way is to use 64-bit integer support
throughout in this case.  This is an attempt.

I've looked at 3.0.6 and there are no off_t members of structs.  There are
ino_t members of structs, but that's returned by readdir() so presumably
the system can get it right (and the code isn't new, so we should know by
now if it didn't).  Neither type needs to be printed out.  So I think the
change is not as urgent in that case, but it might be as well to keep the
64-bit support in sync.

--- INSTALL.off_t	Mon Jun  7 14:29:06 1999
+++ INSTALL	Thu Jun 10 14:39:57 1999
@@ -257,6 +257,11 @@
 enabled.  Hence you might consider using --enable-lfs on any 32-bit system
 with a suitable compiler such as gcc.
 
+Also note that if `configure' finds out that either of the types off_t or
+ino_t are 64-bit quantities, but that long integers are only 32 bits, all
+the above will be enabled automatically.  This is necessary to ensure
+correct handling of these types.
+
 None of this is relevant for 64-bit systems; zsh should compile and run
 without problems if (sizeof(long) == 8).
 
--- configure.in.off_t	Wed Jun  9 13:48:46 1999
+++ configure.in	Thu Jun 10 14:43:47 1999
@@ -556,59 +556,69 @@
 
 if test $zsh_cv_long_is_64_bit = yes; then
   AC_DEFINE(LONG_IS_64_BIT)
-elif test "x$enable_lfs" != x; then
-  AC_CACHE_CHECK(if compiler has a 64 bit type, zsh_cv_64_bit_type,
-  [if test "x$enable_lfs" != xyes; then
-     zsh_64_BIT_TYPE(${enable_lfs}, zsh_cv_64_bit_type, force)
-   else
-     zsh_64_BIT_TYPE(long long, zsh_cv_64_bit_type)
-     if test "$zsh_cv_64_bit_type" = no; then
-       zsh_64_BIT_TYPE(quad_t, zsh_cv_64_bit_type)
-     fi
-     if test "$zsh_cv_64_bit_type" = no; then
-       zsh_64_BIT_TYPE(__int64_t, zsh_cv_64_bit_type)
-     fi
-   fi
-])
-  if test "$zsh_cv_64_bit_type" != no; then
-    AC_DEFINE_UNQUOTED(ZSH_64_BIT_TYPE, $zsh_cv_64_bit_type)
-
-    dnl Handle cases where unsigned type cannot be simply
-    dnl `unsigned ZSH_64_BIT_TYPE'.  More tests may be required.
-    AC_CACHE_CHECK(for a corresponding unsigned 64 bit type,
-    zsh_cv_64_bit_utype,
-    [zsh_64_BIT_TYPE(unsigned $zsh_cv_64_bit_type, zsh_cv_64_bit_utype, force)
-     if test "$zsh_cv_64_bit_utype" = no; then
-       zsh_64_BIT_TYPE(__uint64_t, zsh_cv_64_bit_utype)
-     fi])
-    if test "$zsh_cv_64_bit_utype" != no; then
-      AC_DEFINE_UNQUOTED(ZSH_64_BIT_UTYPE, $zsh_cv_64_bit_utype)
-    fi
-
-    AC_CACHE_CHECK(if off_t is 64 bit, zsh_cv_off_t_is_64_bit,
-    [AC_TRY_RUN([
+else
+  AC_CACHE_CHECK(if off_t is 64 bit, zsh_cv_off_t_is_64_bit,
+  [AC_TRY_RUN([
 #include <sys/types.h>
 
 main() { return sizeof(off_t) < 8; }
 ],
-    zsh_cv_off_t_is_64_bit=yes,
-    zsh_cv_off_t_is_64_bit=no,
-    zsh_cv_off_t_is_64_bit=no)])
-    if test $zsh_cv_off_t_is_64_bit = yes; then
-      AC_DEFINE(OFF_T_IS_64_BIT)
-    fi
+  zsh_cv_off_t_is_64_bit=yes,
+  zsh_cv_off_t_is_64_bit=no,
+  zsh_cv_off_t_is_64_bit=no)])
+  if test $zsh_cv_off_t_is_64_bit = yes; then
+    AC_DEFINE(OFF_T_IS_64_BIT)
+  fi
 
-    AC_CACHE_CHECK(if ino_t is 64 bit, zsh_cv_ino_t_is_64_bit,
-    [AC_TRY_RUN([
+  AC_CACHE_CHECK(if ino_t is 64 bit, zsh_cv_ino_t_is_64_bit,
+  [AC_TRY_RUN([
 #include <sys/types.h>
 
 main() { return sizeof(ino_t) < 8; }
 ],
-    zsh_cv_ino_t_is_64_bit=yes,
-    zsh_cv_ino_t_is_64_bit=no,
-    zsh_cv_ino_t_is_64_bit=no)])
-    if test $zsh_cv_ino_t_is_64_bit = yes; then
-      AC_DEFINE(INO_T_IS_64_BIT)
+  zsh_cv_ino_t_is_64_bit=yes,
+  zsh_cv_ino_t_is_64_bit=no,
+  zsh_cv_ino_t_is_64_bit=no)])
+  if test $zsh_cv_ino_t_is_64_bit = yes; then
+    AC_DEFINE(INO_T_IS_64_BIT)
+  fi
+
+  if test "x$enable_lfs" != xno -o $zsh_cv_off_t_is_64_bit = yes \
+  -o $zsh_cv_ino_t_is_64_bit = yes; then
+    AC_CACHE_CHECK(if compiler has a 64 bit type, zsh_cv_64_bit_type,
+    [if test "x$enable_lfs" != xyes -a "x$enable_lfs" != xno; then
+      zsh_64_BIT_TYPE(${enable_lfs}, zsh_cv_64_bit_type, force)
+     else
+       zsh_64_BIT_TYPE(long long, zsh_cv_64_bit_type)
+       if test "$zsh_cv_64_bit_type" = no; then
+         zsh_64_BIT_TYPE(quad_t, zsh_cv_64_bit_type)
+       fi
+       if test "$zsh_cv_64_bit_type" = no; then
+         zsh_64_BIT_TYPE(__int64_t, zsh_cv_64_bit_type)
+       fi
+       dnl As a last resort, if we know off_t has 64 bits, use that as
+       dnl the 64-bit integer type.  I don't dare try ino_t since there's
+       dnl probably nothing to stop that being unsigned.
+       if test "$zsh_cv_64_bit_type" = no -a \
+       "$zsh_cv_off_t_is_64_bit" = yes; then
+         zsh_64_BIT_TYPE(off_t, zsh_cv_64_bit_type)
+       fi
+     fi])
+    if test "$zsh_cv_64_bit_type" != no; then
+      AC_DEFINE_UNQUOTED(ZSH_64_BIT_TYPE, $zsh_cv_64_bit_type)
+
+      dnl Handle cases where unsigned type cannot be simply
+      dnl `unsigned ZSH_64_BIT_TYPE'.  More tests may be required.
+      AC_CACHE_CHECK(for a corresponding unsigned 64 bit type,
+      zsh_cv_64_bit_utype,
+      [zsh_64_BIT_TYPE(unsigned $zsh_cv_64_bit_type, zsh_cv_64_bit_utype,
+       force)
+       if test "$zsh_cv_64_bit_utype" = no; then
+         zsh_64_BIT_TYPE(__uint64_t, zsh_cv_64_bit_utype)
+       fi])
+      if test "$zsh_cv_64_bit_utype" != no; then
+        AC_DEFINE_UNQUOTED(ZSH_64_BIT_UTYPE, $zsh_cv_64_bit_utype)
+      fi
     fi
   fi
 fi

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1999-06-10 13:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-06-10 13:03 PATCH: pws-21: yes, it's a large integer patch Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).