GLib 1.2[.x] doesn't have g_sprintf(), it just has g_snprintf(); use

that.

It also doesn't hae <glib/gprintf.h>, so use that only for GLib 2.0 and
later.

svn path=/trunk/; revision=18169
This commit is contained in:
Guy Harris 2006-05-15 22:21:51 +00:00
parent c59f032fec
commit 0457e756b1
2 changed files with 6 additions and 2 deletions

View File

@ -246,14 +246,16 @@ AC_DEFUN([AC_WIRETAP_CHECK_64BIT_FORMAT],
AC_LANG_SOURCE(
[[
#include <glib.h>
#if GTK_MAJOR_VERSION >= 2
#include <glib/gprintf.h>
#endif
#include <stdio.h>
main()
{
guint64 t = 1;
char strbuf[16+1];
g_sprintf(strbuf, "%016$1x", t << 32);
g_snprintf(strbuf, sizeof strbuf, "%016$1x", t << 32);
if (strcmp(strbuf, "0000000100000000") == 0)
exit(0);
else

View File

@ -184,13 +184,15 @@ AC_COMPILE_IFELSE(
AC_LANG_SOURCE(
[[
#include <glib.h>
#if GTK_MAJOR_VERSION >= 2
#include <glib/gprintf.h>
#endif
#include <stdio.h>
main()
{
char strbuf[16+1];
g_sprintf(strbuf, "%" G_GINT64_MODIFIER "x\n", (gint64)1);
g_snprintf(strbuf, sizeof strbuf, "%" G_GINT64_MODIFIER "x\n", (gint64)1);
}
]])
],