Added a check for the right format to printf and scanf long longs. It is

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.
This commit is contained in:
Sebastian Wilhelmi 1999-03-30 14:25:50 +00:00 committed by Sebastian Wilhelmi
parent 44714ea838
commit 0ca3f612e7
9 changed files with 69 additions and 2 deletions

View 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> 1999-03-28 Raja R Harinath <harinath@cs.umn.edu>
* Makefile.am (glibconfig.h): Make sure `glibconfig.h' exists * Makefile.am (glibconfig.h): Make sure `glibconfig.h' exists

View 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> 1999-03-28 Raja R Harinath <harinath@cs.umn.edu>
* Makefile.am (glibconfig.h): Make sure `glibconfig.h' exists * Makefile.am (glibconfig.h): Make sure `glibconfig.h' exists

View 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> 1999-03-28 Raja R Harinath <harinath@cs.umn.edu>
* Makefile.am (glibconfig.h): Make sure `glibconfig.h' exists * Makefile.am (glibconfig.h): Make sure `glibconfig.h' exists

View 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> 1999-03-28 Raja R Harinath <harinath@cs.umn.edu>
* Makefile.am (glibconfig.h): Make sure `glibconfig.h' exists * Makefile.am (glibconfig.h): Make sure `glibconfig.h' exists

View 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> 1999-03-28 Raja R Harinath <harinath@cs.umn.edu>
* Makefile.am (glibconfig.h): Make sure `glibconfig.h' exists * Makefile.am (glibconfig.h): Make sure `glibconfig.h' exists

View 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> 1999-03-28 Raja R Harinath <harinath@cs.umn.edu>
* Makefile.am (glibconfig.h): Make sure `glibconfig.h' exists * Makefile.am (glibconfig.h): Make sure `glibconfig.h' exists

View 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> 1999-03-28 Raja R Harinath <harinath@cs.umn.edu>
* Makefile.am (glibconfig.h): Make sure `glibconfig.h' exists * Makefile.am (glibconfig.h): Make sure `glibconfig.h' exists

View 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> 1999-03-28 Raja R Harinath <harinath@cs.umn.edu>
* Makefile.am (glibconfig.h): Make sure `glibconfig.h' exists * Makefile.am (glibconfig.h): Make sure `glibconfig.h' exists

View File

@ -199,6 +199,25 @@ AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(void *) AC_CHECK_SIZEOF(void *)
AC_CHECK_SIZEOF(long long) 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 long doubles were not used, and a portability problem
dnl AC_C_LONG_DOUBLE dnl AC_C_LONG_DOUBLE
AC_C_CONST AC_C_CONST
@ -1128,8 +1147,8 @@ $ac_cv_sizeof_long)
;; ;;
$ac_cv_sizeof_long_long) $ac_cv_sizeof_long_long)
gint64='long long' gint64='long long'
gint64_format='"lli"' gint64_format='"'$glib_cv_long_long_format'i"'
guint64_format='"llu"' guint64_format='"'$glib_cv_long_long_format'u"'
glib_extension='G_GNUC_EXTENSION ' glib_extension='G_GNUC_EXTENSION '
glib_warning_guard=" glib_warning_guard="
#if defined (__GNUC__) && __GNUC__ >= 2 && __GNUC_MINOR__ >= 8 #if defined (__GNUC__) && __GNUC__ >= 2 && __GNUC_MINOR__ >= 8