diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2009-11-15 16:18:58 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2009-11-15 16:18:58 (GMT) |
commit | 82864d1ab101d971e77b73cac9e994fd09cd796b (patch) | |
tree | 65335906c1a5f330660bb1f64d698198d50856d3 /configure.in | |
parent | d5b34d4597a7163edf20f831db620b0a4fe57d5d (diff) | |
download | cpython-82864d1ab101d971e77b73cac9e994fd09cd796b.zip cpython-82864d1ab101d971e77b73cac9e994fd09cd796b.tar.gz cpython-82864d1ab101d971e77b73cac9e994fd09cd796b.tar.bz2 |
Issue #7228: Add '%lld' and '%llu' support to PyFormat_FromString,
PyFormat_FromStringV and PyErr_Format.
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/configure.in b/configure.in index 18555ee..fe8bb2b 100644 --- a/configure.in +++ b/configure.in @@ -3952,6 +3952,54 @@ else AC_MSG_RESULT(no) fi +if test "$have_long_long" = yes +then + AC_MSG_CHECKING(for %lld and %llu printf() format support) + AC_CACHE_VAL(ac_cv_have_long_long_format, + AC_TRY_RUN([[ + #include <stdio.h> + #include <stddef.h> + #include <string.h> + + #ifdef HAVE_SYS_TYPES_H + #include <sys/types.h> + #endif + + int main() + { + char buffer[256]; + + if (sprintf(buffer, "%lld", (long long)123) < 0) + return 1; + if (strcmp(buffer, "123")) + return 1; + + if (sprintf(buffer, "%lld", (long long)-123) < 0) + return 1; + if (strcmp(buffer, "-123")) + return 1; + + if (sprintf(buffer, "%llu", (unsigned long long)123) < 0) + return 1; + if (strcmp(buffer, "123")) + return 1; + + return 0; + } + ]], ac_cv_have_long_long_format=yes, + ac_cv_have_long_long_format=no, + ac_cv_have_long_long_format=no) + ) + AC_MSG_RESULT($ac_cv_have_long_long_format) +fi + +if test $ac_cv_have_long_long_format = yes +then + AC_DEFINE(PY_FORMAT_LONG_LONG, "ll", + [Define to printf format modifier for long long type]) +fi + + AC_CACHE_CHECK([for %zd printf() format support], ac_cv_have_size_t_format, [dnl AC_TRY_RUN([ #include <stdio.h> |