This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Bug other/15194] [fastjar] Check for "long long" before using it
- From: Kelley Cook <kcook at gcc dot gnu dot org>
- To: GCC Bug Database <gcc-bugzilla at gcc dot gnu dot org>, GCC Patches <gcc-patches at gcc dot gnu dot org>, GCJ-patches <java-patches at gcc dot gnu dot org>
- Cc: Paolo Bonzini <bonzini at gnu dot org>, Nathanael Nerode <neroden at twcny dot rr dot com>, Alexandre Oliva <aoliva at redhat dot com>
- Date: Fri, 25 Jun 2004 11:30:44 -0400
- Subject: [Bug other/15194] [fastjar] Check for "long long" before using it
- Hop-count: 1
This trivial patch should fix PR/15194, which was a regression from 3.2
present on 3.[345].
It was bootstrapped (with no object code changes) on i686-pc-cygwin.
Unfortunately, I do not have ready access to a compiler without long
long support, so I cannot absolutely verify does fix the reporter's bug;
though, clearly, it cannot make things worse.
OK to install?
As an aside, I've come to believe that it would be appropriate to
arrange for the toplevel Makefile so that, unless requested with a
--without-system-jar, when bootstrapping only compile fastjar for the
*build* system if there is not already a suitable "jar" present. I
think that it currently gets built and goes unused.
Clearly in a cross compile you would need to build fastjar for the host
system.
I'll think through the logic of that over the weekend, but any comments
from the build experts would be welcome.
Kelley Cook
2004-06-25 Kelley Cook <kcook@gcc.gnu.org>
* configure.ac: Add check for long long.
* jartool.h: Check for long long before using it.
* configure: Regenerate
* config.h.in: Regenerate.
diff -prud /home/kcook34/gcc-orig/fastjar/configure.ac ./configure.ac
--- /home/kcook34/gcc-orig/fastjar/configure.ac 2004-04-12 16:29:49.000000000 -0400
+++ ./configure.ac 2004-06-25 10:41:12.919581100 -0400
@@ -39,7 +39,7 @@ AC_COMPILE_CHECK_SIZEOF(char)
AC_COMPILE_CHECK_SIZEOF(short)
AC_COMPILE_CHECK_SIZEOF(int)
AC_COMPILE_CHECK_SIZEOF(long)
-AC_COMPILE_CHECK_SIZEOF(long long)
+AC_CHECK_TYPES([long long],[AC_COMPILE_CHECK_SIZEOF(long long)])
dnl Check byte order
AC_C_BIGENDIAN_CROSS
diff -prud /home/kcook34/gcc-orig/fastjar/jartool.h ./jartool.h
--- /home/kcook34/gcc-orig/fastjar/jartool.h 2000-12-08 22:08:23.000000000 -0500
+++ ./jartool.h 2004-06-25 10:49:06.742005100 -0400
@@ -90,7 +90,7 @@ typedef u_int16_t ub2;
typedef unsigned int ub4;
#elif SIZEOF_LONG == 4
typedef unsigned long ub4;
-#elif SIZEOF_LONG_LONG == 4
+#elif defined(HAVE_LONG_LONG) && SIZEOF_LONG_LONG == 4
typedef unsigned long long ub4;
#else
typedef u_int32_t ub4;