From dfb37ae154922dd95380f8c335805a121580d036 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Sun, 9 May 2021 08:48:26 -0600 Subject: [PATCH] Add check for nl_langinfo_l() There is already a check for this, but it fails unless the function is thread safe. This adds a symbol for when it exists but isn't thread safe. --- U/threads/d_nl_langinfo_l.U | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/U/threads/d_nl_langinfo_l.U b/U/threads/d_nl_langinfo_l.U index ae8e5c9..8ff4fb4 100644 --- a/U/threads/d_nl_langinfo_l.U +++ b/U/threads/d_nl_langinfo_l.U @@ -5,26 +5,36 @@ ?RCS: You may distribute under the terms of either the GNU General Public ?RCS: License or the Artistic License, as specified in the README file. ?RCS: -?MAKE:d_thread_safe_nl_langinfo_l: Compile cat rm_try Oldconfig \ +?MAKE:d_nl_langinfo_l d_thread_safe_nl_langinfo_l: Compile cat rm_try Oldconfig \ i_pthread i_stdlib i_langinfo i_locale \ usethreads run ?MAKE: -pick add $@ %< +?S:d_nl_langinfo_l: +?S: This variable contains the eventual value of the +?S: HAS_NL_LANGINFO_L symbol, which indicates if the +?S: nl_langinfo_l() function exists. +?S:. ?S:d_thread_safe_nl_langinfo_l: ?S: This variable contains the eventual value of the ?S: HAS_THREAD_SAFE_NL_LANGINFO_L symbol, which indicates if the ?S: nl_langinfo_l() function exists and is thread-safe. ?S:. +?C:HAS_NL_LANGINFO_L: +?C: This symbol, when defined, indicates presence of the nl_langinfo_l() +?C: function +?C:. ?C:HAS_THREAD_SAFE_NL_LANGINFO_L: ?C: This symbol, when defined, indicates presence of the nl_langinfo_l() ?C: function, and that it is thread-safe. ?C:. +?H:#$d_nl_langinfo_l HAS_NL_LANGINFO_L /**/ ?H:#$d_thread_safe_nl_langinfo_l HAS_THREAD_SAFE_NL_LANGINFO_L /**/ ?H:. ?F:!try -: check for thread_safe_nl_langinfo_l item +: check for nl_langinfo_l item $cat <&4 + d_nl_langinfo_l="$define" + echo "$d_nl_langinfo_l" >&4 if $run ./try; then echo "and it is thread-safe (just as I'd hoped)." >&4 d_thread_safe_nl_langinfo_l="$define" echo "$d_thread_safe_nl_langinfo_l" >&4 else - echo "but it isn't thread-safe, so we won't use it." >&4 + echo "but it isn't thread-safe." >&4 fi else echo "your system does not have nl_langinfo_l()" >&4 @@ -114,6 +123,9 @@ case "$usethreads" in ;; *) echo "Since threads aren't selected, we won't bother looking for nl_langinfo_l()" >&4 esac +if test X"$d_nl_langinfo_l" = X; then + d_nl_langinfo_l="$undef" +fi if test X"$d_thread_safe_nl_langinfo_l" = X; then d_thread_safe_nl_langinfo_l="$undef" fi -- 1.8.3.1