diff options
| author | Brett Cannon <bcannon@gmail.com> | 2006-05-11 05:11:33 +0000 |
|---|---|---|
| committer | Brett Cannon <bcannon@gmail.com> | 2006-05-11 05:11:33 +0000 |
| commit | d618a28438782e4fb524b2deaccbc8860544defe (patch) | |
| tree | 8cd042bcde75df698a0ccf1572a8c16c724487d5 /configure.in | |
| parent | 1a7c5ebeb05e0c5cb25b04ff3825e49eeebd3873 (diff) | |
| download | cpython-d618a28438782e4fb524b2deaccbc8860544defe.tar.gz | |
Detect if %zd is supported by printf() during configure and sets
PY_FORMAT_SIZE_T appropriately. Removes warnings on
OS X under gcc 4.0.1 when PY_FORMAT_SIZE_T is set to "" instead of "z" as is
needed.
Diffstat (limited to 'configure.in')
| -rw-r--r-- | configure.in | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/configure.in b/configure.in index e2dae9d484..168c621aeb 100644 --- a/configure.in +++ b/configure.in @@ -3247,6 +3247,27 @@ else AC_MSG_RESULT(no) fi +AC_MSG_CHECKING(for %zd printf() format support) +AC_TRY_RUN([#include <stdio.h> +#include <stddef.h> +#include <string.h> + +int main() +{ + char buffer[4]; + + if(sprintf(buffer, "%zd", (size_t)123) < 0) + return 1; + + if (strncmp(buffer, "123", 3)) + return 1; + + return 0; +}], +[AC_MSG_RESULT(yes) + AC_DEFINE(PY_FORMAT_SIZE_T, "z", [Define to printf format modifier for Py_ssize_t])], + AC_MSG_RESULT(no)) + AC_CHECK_TYPE(socklen_t,, AC_DEFINE(socklen_t,int, Define to `int' if <sys/socket.h> does not define.),[ |
