diff options
author | blhsing <blhsing@gmail.com> | 2024-08-23 15:45:03 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-23 15:45:03 (GMT) |
commit | 126910edba812a01794f307b0cfa2a7f02bda190 (patch) | |
tree | e86e74c3e38f2b8cfcbe9484dc696a0c52767a3f /configure | |
parent | 7cd3aa42f0cf72bf9a214e2630850879fe078377 (diff) | |
download | cpython-126910edba812a01794f307b0cfa2a7f02bda190.zip cpython-126910edba812a01794f307b0cfa2a7f02bda190.tar.gz cpython-126910edba812a01794f307b0cfa2a7f02bda190.tar.bz2 |
gh-122272: Guarantee specifiers %F and %C for datetime.strftime to be 0-padded (GH-122436)
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 52 |
1 files changed, 52 insertions, 0 deletions
@@ -26196,6 +26196,58 @@ printf "%s\n" "#define Py_NORMALIZE_CENTURY 1" >>confdefs.h fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C99-specific strftime specifiers are supported" >&5 +printf %s "checking whether C99-specific strftime specifiers are supported... " >&6; } +if test ${ac_cv_strftime_c99_support+y} +then : + printf %s "(cached) " >&6 +else $as_nop + +if test "$cross_compiling" = yes +then : + ac_cv_strftime_c99_support=no +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <time.h> +#include <string.h> + +int main(void) +{ + char full_date[11]; + struct tm date = { + .tm_year = 0, + .tm_mon = 0, + .tm_mday = 1 + }; + if (strftime(full_date, sizeof(full_date), "%F", &date) && !strcmp(full_date, "1900-01-01")) { + return 0; + } + return 1; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_strftime_c99_support=yes +else $as_nop + ac_cv_strftime_c99_support=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_strftime_c99_support" >&5 +printf "%s\n" "$ac_cv_strftime_c99_support" >&6; } +if test "$ac_cv_strftime_c99_support" = yes +then + +printf "%s\n" "#define Py_STRFTIME_C99_SUPPORT 1" >>confdefs.h + +fi + have_curses=no have_panel=no |