summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorblhsing <blhsing@gmail.com>2024-06-29 06:32:42 (GMT)
committerGitHub <noreply@github.com>2024-06-29 06:32:42 (GMT)
commit6d34938dc8163f4a4bcc68069a1645a7ab76e935 (patch)
treeedfb0067fe8ef38fc9c1533a5aa12459eb885c31 /configure
parent92893fd8dc803ed7cdde55d29d25f84ccb5e3ef0 (diff)
downloadcpython-6d34938dc8163f4a4bcc68069a1645a7ab76e935.zip
cpython-6d34938dc8163f4a4bcc68069a1645a7ab76e935.tar.gz
cpython-6d34938dc8163f4a4bcc68069a1645a7ab76e935.tar.bz2
gh-120713: Normalize year with century for datetime.strftime (GH-120820)
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure52
1 files changed, 52 insertions, 0 deletions
diff --git a/configure b/configure
index 527bb0b..58be837 100755
--- a/configure
+++ b/configure
@@ -25952,6 +25952,58 @@ printf "%s\n" "#define HAVE_STAT_TV_NSEC2 1" >>confdefs.h
fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether year with century should be normalized for strftime" >&5
+printf %s "checking whether year with century should be normalized for strftime... " >&6; }
+if test ${ac_cv_normalize_century+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+
+if test "$cross_compiling" = yes
+then :
+ ac_cv_normalize_century=yes
+else $as_nop
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <time.h>
+#include <string.h>
+
+int main(void)
+{
+ char year[5];
+ struct tm date = {
+ .tm_year = -1801,
+ .tm_mon = 0,
+ .tm_mday = 1
+ };
+ if (strftime(year, sizeof(year), "%Y", &date) && !strcmp(year, "0099")) {
+ return 1;
+ }
+ return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+ ac_cv_normalize_century=yes
+else $as_nop
+ ac_cv_normalize_century=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_normalize_century" >&5
+printf "%s\n" "$ac_cv_normalize_century" >&6; }
+if test "$ac_cv_normalize_century" = yes
+then
+
+printf "%s\n" "#define Py_NORMALIZE_CENTURY 1" >>confdefs.h
+
+fi
+
have_curses=no
have_panel=no