Added a check for the right format to printf and scanf long longs. It is
authorSebastian Wilhelmi <wilhelmi@ira.uka.de>
Tue, 30 Mar 1999 14:25:50 +0000 (14:25 +0000)
committerSebastian Wilhelmi <wilhelmi@src.gnome.org>
Tue, 30 Mar 1999 14:25:50 +0000 (14:25 +0000)
1999-03-30  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>

* configure.in: Added a check for the right format to printf and
scanf long longs. It is %qi instead of %lli on FreeBSD for
whatever reason.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
configure.in

index 20c6f47..ab24002 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+1999-03-30  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * configure.in: Added a check for the right format to printf and
+       scanf long longs. It is %qi instead of %lli on FreeBSD for
+       whatever reason.
+
 1999-03-28  Raja R Harinath  <harinath@cs.umn.edu>
 
        * Makefile.am (glibconfig.h): Make sure `glibconfig.h' exists
index 20c6f47..ab24002 100644 (file)
@@ -1,3 +1,9 @@
+1999-03-30  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * configure.in: Added a check for the right format to printf and
+       scanf long longs. It is %qi instead of %lli on FreeBSD for
+       whatever reason.
+
 1999-03-28  Raja R Harinath  <harinath@cs.umn.edu>
 
        * Makefile.am (glibconfig.h): Make sure `glibconfig.h' exists
index 20c6f47..ab24002 100644 (file)
@@ -1,3 +1,9 @@
+1999-03-30  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * configure.in: Added a check for the right format to printf and
+       scanf long longs. It is %qi instead of %lli on FreeBSD for
+       whatever reason.
+
 1999-03-28  Raja R Harinath  <harinath@cs.umn.edu>
 
        * Makefile.am (glibconfig.h): Make sure `glibconfig.h' exists
index 20c6f47..ab24002 100644 (file)
@@ -1,3 +1,9 @@
+1999-03-30  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * configure.in: Added a check for the right format to printf and
+       scanf long longs. It is %qi instead of %lli on FreeBSD for
+       whatever reason.
+
 1999-03-28  Raja R Harinath  <harinath@cs.umn.edu>
 
        * Makefile.am (glibconfig.h): Make sure `glibconfig.h' exists
index 20c6f47..ab24002 100644 (file)
@@ -1,3 +1,9 @@
+1999-03-30  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * configure.in: Added a check for the right format to printf and
+       scanf long longs. It is %qi instead of %lli on FreeBSD for
+       whatever reason.
+
 1999-03-28  Raja R Harinath  <harinath@cs.umn.edu>
 
        * Makefile.am (glibconfig.h): Make sure `glibconfig.h' exists
index 20c6f47..ab24002 100644 (file)
@@ -1,3 +1,9 @@
+1999-03-30  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * configure.in: Added a check for the right format to printf and
+       scanf long longs. It is %qi instead of %lli on FreeBSD for
+       whatever reason.
+
 1999-03-28  Raja R Harinath  <harinath@cs.umn.edu>
 
        * Makefile.am (glibconfig.h): Make sure `glibconfig.h' exists
index 20c6f47..ab24002 100644 (file)
@@ -1,3 +1,9 @@
+1999-03-30  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * configure.in: Added a check for the right format to printf and
+       scanf long longs. It is %qi instead of %lli on FreeBSD for
+       whatever reason.
+
 1999-03-28  Raja R Harinath  <harinath@cs.umn.edu>
 
        * Makefile.am (glibconfig.h): Make sure `glibconfig.h' exists
index 20c6f47..ab24002 100644 (file)
@@ -1,3 +1,9 @@
+1999-03-30  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
+
+       * configure.in: Added a check for the right format to printf and
+       scanf long longs. It is %qi instead of %lli on FreeBSD for
+       whatever reason.
+
 1999-03-28  Raja R Harinath  <harinath@cs.umn.edu>
 
        * Makefile.am (glibconfig.h): Make sure `glibconfig.h' exists
index 12c2ea1..8eb451c 100644 (file)
@@ -199,6 +199,25 @@ AC_CHECK_SIZEOF(int)
 AC_CHECK_SIZEOF(void *)
 AC_CHECK_SIZEOF(long long)
 
+if test x$ac_cv_sizeof_long_long = x8; then
+       # long long is a 64 bit integer.
+       AC_MSG_CHECKING(for format to printf and scanf a gint64)
+       AC_CACHE_VAL(glib_cv_long_long_format,[
+               AC_TRY_RUN([#include <stdio.h>  
+                       int main()
+                       {
+                         long long b, a = -0x3AFAFAFAFAFAFAFALL;
+                         char buffer[1000];
+                         sprintf (buffer, "%llu", a);
+                         sscanf (buffer, "%llu", &b);
+                         exit (b!=a);
+                       }
+                       ],
+                       glib_cv_long_long_format=ll,
+                       glib_cv_long_long_format=q)])
+       AC_MSG_RESULT(%${glib_cv_long_long_format}i)
+fi
+
 dnl long doubles were not used, and a portability problem
 dnl AC_C_LONG_DOUBLE
 AC_C_CONST
@@ -1128,8 +1147,8 @@ $ac_cv_sizeof_long)
   ;;
 $ac_cv_sizeof_long_long)
   gint64='long long'
-  gint64_format='"lli"'
-  guint64_format='"llu"'
+  gint64_format='"'$glib_cv_long_long_format'i"'
+  guint64_format='"'$glib_cv_long_long_format'u"'
   glib_extension='G_GNUC_EXTENSION '
   glib_warning_guard="
 #if defined (__GNUC__) && __GNUC__ >= 2 && __GNUC_MINOR__ >= 8