pearu commented on code in PR #54656:
URL: https://github.com/apache/arrow/pull/54656#discussion_r4322495539
##########
cpp/src/arrow/vendored/musl/strptime.c:
##########
@@ -17,12 +17,29 @@
#undef HAVE_LANGINFO
-#ifndef _WIN32
+#if !defined(_WIN32) && !defined(ARROW_TEST_FALLBACK_LANGINFO)
Review Comment:
It was only for compiling the fallback on Linux for manual testing. Removed;
the fallback is tested by `StrptimeLocaleDirectives` on the Windows CI jobs.
##########
cpp/src/arrow/vendored/musl/strptime.c:
##########
@@ -17,12 +17,29 @@
#undef HAVE_LANGINFO
-#ifndef _WIN32
+#if !defined(_WIN32) && !defined(ARROW_TEST_FALLBACK_LANGINFO)
#define HAVE_LANGINFO 1
#endif
#ifdef HAVE_LANGINFO
#include <langinfo.h>
+#else
+// C-locale replacement for nl_langinfo(), restricted to the items used below.
+// The constants follow the glibc/musl layout that the symbolic_range loop
+// relies on: full names directly follow the abbreviated ones.
+enum { ABDAY_1 = 0, DAY_1 = 7, ABMON_1 = 14, MON_1 = 26, AM_STR = 38, PM_STR =
39,
+ D_T_FMT = 40, D_FMT = 41, T_FMT = 42, T_FMT_AMPM = 43 };
+static const char *arrow_c_langinfo[] = {
+ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat",
+ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday",
"Saturday",
+ "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
+ "January", "February", "March", "April", "May", "June",
+ "July", "August", "September", "October", "November", "December",
+ "AM", "PM",
+ "%a %b %e %T %Y", "%m/%d/%y", "%H:%M:%S", "%I:%M:%S %p"};
Review Comment:
They are the values of the [POSIX
locale](https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap07.html#tag_07_03_05_03)
(`LC_TIME` in POSIX.1, chapter 7), which musl's own C locale ([`c_time` in
`src/locale/langinfo.c`](https://git.musl-libc.org/cgit/musl/tree/src/locale/langinfo.c))
uses in the same order; [glibc's C
locale](https://sourceware.org/git/?p=glibc.git;a=blob;f=locale/C-time.c) has
the same values. Added this to the comment.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]