diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2009-11-16 17:00:11 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2009-11-16 17:00:11 (GMT) |
commit | 6ce4a9a9f2d690e9ce7121154fd9cc04082d7f59 (patch) | |
tree | 4aacd6f6dd48c7fdd464cfb274108b5e5d16a725 /configure.in | |
parent | 260bd3e5578008682f009530faa615f74c6bcf82 (diff) | |
download | cpython-6ce4a9a9f2d690e9ce7121154fd9cc04082d7f59.zip cpython-6ce4a9a9f2d690e9ce7121154fd9cc04082d7f59.tar.gz cpython-6ce4a9a9f2d690e9ce7121154fd9cc04082d7f59.tar.bz2 |
Merged revisions 76308 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r76308 | mark.dickinson | 2009-11-15 16:18:58 +0000 (Sun, 15 Nov 2009) | 3 lines
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 4a0bf68..2a0745f 100644 --- a/configure.in +++ b/configure.in @@ -3806,6 +3806,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_MSG_CHECKING(for %zd printf() format support) AC_CACHE_VAL(ac_cv_have_size_t_format, AC_TRY_RUN([[ |