Add long long support for printf-style functions.

pull/193/head
Michael R Sweet 15 years ago
parent fa33165459
commit 9ac6418218
  1. 3
      CHANGES
  2. 9
      config.h.in
  3. 61
      configure
  4. 16
      configure.in
  5. 7
      mxml-string.c
  6. 11
      vcnet/config.h

@ -1,9 +1,10 @@
CHANGES - 2009-03-20
CHANGES - 2009-04-18
--------------------
CHANGES IN Mini-XML 2.6
- Documentation fixes (STR #91, STR #92)
- Added support for "long long" printf formats.
- The XML parser now rejects UTF-8 XML files that start with a BOM
(STR #89)
- The mxmldoc program now supports generating Xcode documentation

@ -3,7 +3,7 @@
*
* Configuration file for Mini-XML, a small XML-like file parsing library.
*
* Copyright 2003-2007 by Michael Sweet.
* Copyright 2003-2009 by Michael Sweet.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@ -41,6 +41,13 @@
#define inline
/*
* Long long support...
*/
#undef HAVE_LONG_LONG
/*
* Do we have the snprintf() and vsnprintf() functions?
*/

61
configure vendored

@ -3756,6 +3756,67 @@ done
fi
{ echo "$as_me:$LINENO: checking for long long int" >&5
echo $ECHO_N "checking for long long int... $ECHO_C" >&6; }
if test "${ac_cv_c_long_long+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test "$GCC" = yes; then
ac_cv_c_long_long=yes
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int
main ()
{
long long int i;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
ac_cv_c_long_long=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_c_long_long=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
fi
{ echo "$as_me:$LINENO: result: $ac_cv_c_long_long" >&5
echo "${ECHO_T}$ac_cv_c_long_long" >&6; }
if test $ac_cv_c_long_long = yes; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_LONG_LONG 1
_ACEOF
fi
# Check whether --enable-threads was given.
if test "${enable_threads+set}" = set; then
enableval=$enable_threads;

@ -3,7 +3,7 @@ dnl "$Id$"
dnl
dnl Configuration script for Mini-XML, a small XML-like file parsing library.
dnl
dnl Copyright 2003-2008 by Michael Sweet.
dnl Copyright 2003-2009 by Michael Sweet.
dnl
dnl This program is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Library General Public
@ -106,6 +106,20 @@ if test "x$use_vsnprintf" != xyes; then
AC_CHECK_FUNCS(snprintf vsnprintf)
fi
dnl Check for "long long" support...
AC_CACHE_CHECK(for long long int, ac_cv_c_long_long,
[if test "$GCC" = yes; then
ac_cv_c_long_long=yes
else
AC_TRY_COMPILE(,[long long int i;],
ac_cv_c_long_long=yes,
ac_cv_c_long_long=no)
fi])
if test $ac_cv_c_long_long = yes; then
AC_DEFINE(HAVE_LONG_LONG)
fi
dnl Threading support
AC_ARG_ENABLE(threads, [ --enable-threads enable multi-threading support])

@ -3,7 +3,7 @@
*
* String functions for Mini-XML, a small XML-like file parsing library.
*
* Copyright 2003-2007 by Michael Sweet.
* Copyright 2003-2009 by Michael Sweet.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@ -287,6 +287,11 @@ _mxml_vsnprintf(char *buffer, /* O - Output buffer */
if ((width + 2) > sizeof(temp))
break;
#ifdef HAVE_LONG_LONG
if (size == 'L')
sprintf(temp, tformat, va_arg(ap, long long));
else
#endif /* HAVE_LONG_LONG */
sprintf(temp, tformat, va_arg(ap, int));
bytes += strlen(temp);

@ -3,7 +3,7 @@
*
* Configuration file for Mini-XML, a small XML-like file parsing library.
*
* Copyright 2003-2008 by Michael Sweet.
* Copyright 2003-2009 by Michael Sweet.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@ -66,7 +66,7 @@
* Version number...
*/
#define MXML_VERSION "Mini-XML v2.4.1"
#define MXML_VERSION "Mini-XML v2.6"
/*
@ -76,6 +76,13 @@
#define inline _inline
/*
* Long long support...
*/
#define HAVE_LONG_LONG 1
/*
* Do we have the snprintf() and vsnprintf() functions?
*/

Loading…
Cancel
Save