diff options
author | Sebastian Wilhelmi <wilhelmi@ira.uka.de> | 1999-03-30 14:25:50 +0000 |
---|---|---|
committer | Sebastian Wilhelmi <wilhelmi@src.gnome.org> | 1999-03-30 14:25:50 +0000 |
commit | 0ca3f612e7f813897f0b322bde7276f4c1eb64e4 (patch) | |
tree | a9bf974f8113662f9985966ad606b16e8ad1e56c /configure.in | |
parent | 44714ea8382e37e48f68cc4660c198735a87963c (diff) |
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.
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/configure.in b/configure.in index 12c2ea156..8eb451c87 100644 --- a/configure.in +++ b/configure.in @@ -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 |