This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Probe for working wcscmp and wcsxfrm
authorH.Merijn Brand <h.m.brand@xs4all.nl>
Mon, 2 Jun 2014 15:11:05 +0000 (17:11 +0200)
committerYves Orton <demerphq@gmail.com>
Thu, 5 Jun 2014 10:08:43 +0000 (12:08 +0200)
15 files changed:
Configure
Cross/config.sh-arm-linux
NetWare/config.wc
Porting/Glossary
Porting/config.sh
config_h.SH
configure.com
plan9/config_sh.sample
symbian/config.sh
uconfig.h
uconfig.sh
uconfig64.sh
win32/config.ce
win32/config.gc
win32/config.vc

index bf4ff99..f3f648b 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -845,7 +845,9 @@ d_charvspr=''
 d_vprintf=''
 d_wait4=''
 d_waitpid=''
+d_wcscmp=''
 d_wcstombs=''
+d_wcsxfrm=''
 d_wctomb=''
 d_writev=''
 dlext=''
@@ -19198,10 +19200,67 @@ eval $inlibc
 set waitpid d_waitpid
 eval $inlibc
 
+: look for wcscmp
+echo " "
+$cat >try.c <<'EOCP'
+#include <stdio.h>
+#include <wchar.h>
+int main ()
+{
+    wchar_t *s = L" ";
+    return (wcscmp (s, s) ? 1 : 0);
+    }
+EOCP
+set try
+val="$undef"
+if eval $compile; then
+    `$run ./try`
+    case "$?" in
+       0)  echo "A working wcscmp() found." >&4
+           val="$define" ;;
+       *)  echo "wcscmp() found, but it doesn't work" >&4
+           ;;
+       esac
+else
+    echo "wcscmp() NOT found." >&4
+    fi
+set d_wcscmp
+eval $setvar
+$rm_try
+
 : see if wcstombs exists
 set wcstombs d_wcstombs
 eval $inlibc
 
+: look for wcsxfrm
+echo " "
+$cat >try.c <<'EOCP'
+#include <errno.h>
+#include <wchar.h>
+int main ()
+{
+    wchar_t dst[4], *src = L" ";
+    errno = 0;
+    return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
+    }
+EOCP
+set try
+val="$undef"
+if eval $compile; then
+    `$run ./try`
+    case "$?" in
+       0)  echo "A working wcsxfrm() found." >&4
+           val="$define" ;;
+       *)  echo "wcsxfrm() found, but it doesn't work" >&4
+           ;;
+       esac
+else
+    echo "wcsxfrm() NOT found." >&4
+    fi
+set d_wcsxfrm
+eval $setvar
+$rm_try
+
 : see if wctomb exists
 set wctomb d_wctomb
 eval $inlibc
@@ -23409,7 +23468,9 @@ d_vprintf='$d_vprintf'
 d_vsnprintf='$d_vsnprintf'
 d_wait4='$d_wait4'
 d_waitpid='$d_waitpid'
+d_wcscmp='$d_wcscmp'
 d_wcstombs='$d_wcstombs'
+d_wcsxfrm='$d_wcsxfrm'
 d_wctomb='$d_wctomb'
 d_writev='$d_writev'
 d_xenix='$d_xenix'
index 82821d4..25ea52c 100644 (file)
@@ -540,7 +540,9 @@ d_vprintf='define'
 d_vsnprintf='define'
 d_wait4='define'
 d_waitpid='define'
+d_wcscmp=''undef''
 d_wcstombs='define'
+d_wcsxfrm=''undef''
 d_wctomb='define'
 d_writev='define'
 d_xenix='undef'
index 5ad00a8..60cfd10 100644 (file)
@@ -529,7 +529,9 @@ d_vprintf='define'
 d_vsnprintf='undef'
 d_wait4='undef'
 d_waitpid='define'
+d_wcscmp=''undef''
 d_wcstombs='define'
+d_wcsxfrm=''undef''
 d_wctomb='define'
 d_writev='undef'
 d_xenix='undef'
index cf6c244..301fa66 100644 (file)
@@ -2503,11 +2503,21 @@ d_waitpid (d_waitpid.U):
        This variable conditionally defines HAS_WAITPID if waitpid() is
        available to wait for child process.
 
+d_wcscmp (d_wcscmp.U):
+       This variable conditionally defines the HAS_WCSCMP symbol if the
+       wcscmp() routine is available and can be used to compare wide
+       character strings.
+
 d_wcstombs (d_wcstombs.U):
        This variable conditionally defines the HAS_WCSTOMBS symbol, which
        indicates to the C program that the wcstombs() routine is available
        to convert wide character strings to multibyte strings.
 
+d_wcsxfrm (d_wcsxfrm.U):
+       This variable conditionally defines the HAS_WCSXFRM symbol if the
+       wcsxfrm() routine is available and can be used to compare wide
+       character strings.
+
 d_wctomb (d_wctomb.U):
        This variable conditionally defines the HAS_WCTOMB symbol, which
        indicates to the C program that the wctomb() routine is available
index 11871d3..e9d89fa 100644 (file)
@@ -551,7 +551,9 @@ d_vprintf='define'
 d_vsnprintf='define'
 d_wait4='define'
 d_waitpid='define'
+d_wcscmp=''undef''
 d_wcstombs='define'
+d_wcsxfrm=''undef''
 d_wctomb='define'
 d_writev='define'
 d_xenix='undef'
index b3d2cc5..5b38733 100755 (executable)
@@ -281,13 +281,13 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un
 
 /* HAS_MBSTOWCS:
  *     This symbol, if defined, indicates that the mbstowcs routine is
- *     available to covert a multibyte string into a wide character string.
+ *     available to convert a multibyte string into a wide character string.
  */
 #$d_mbstowcs   HAS_MBSTOWCS            /**/
 
 /* HAS_MBTOWC:
  *     This symbol, if defined, indicates that the mbtowc routine is available
- *     to covert a multibyte to a wide character.
+ *     to convert a multibyte to a wide character.
  */
 #$d_mbtowc HAS_MBTOWC          /**/
 
@@ -649,7 +649,7 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un
 
 /* HAS_WCTOMB:
  *     This symbol, if defined, indicates that the wctomb routine is available
- *     to covert a wide character to a multibyte.
+ *     to convert a wide character to a multibyte.
  */
 #$d_wctomb HAS_WCTOMB          /**/
 
@@ -4166,6 +4166,18 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un
  */
 #$d_ustat HAS_USTAT            /**/
 
+/* HAS_WCSCMP:
+ *     This symbol, if defined, indicates that the wcscmp routine is
+ *     available to compare two wide character strings.
+ */
+#$d_wcscmp HAS_WCSCMP  /**/
+
+/* HAS_WCSXFRM:
+ *     This symbol, if defined, indicates that the wcsxfrm routine is
+ *     available to tranform a wide character string for wcscmp().
+ */
+#$d_wcsxfrm HAS_WCSXFRM        /**/
+
 /* HAS_WRITEV:
  *     This symbol, if defined, indicates that the writev routine is
  *     available to do scatter writes.
index 48f6105..a38e3ed 100644 (file)
@@ -5391,44 +5391,48 @@ $!
 $! Dec C alone
 $ IF ccname .EQS. "DEC" .OR. ccname .EQS. "CXX"
 $ THEN
+$   d_faststdio="define"
+$   d_locconv="define"
+$   d_mblen="define"
 $   d_mbstowcs="define"
 $   d_mbtowc="define"
+$   d_mktime="define"
+$   d_nl_langinfo="define"
+$   d_setlocale="define"
 $   d_stdiobase="define"
 $   d_stdio_cnt_lval="define"
 $   d_stdio_ptr_lval="define"
 $   d_stdstdio="define"
-$   d_faststdio="define"
-$   d_wcstombs="define"
-$   d_mblen="define"
-$   d_mktime="define"
 $   d_strcoll="define"
 $   d_strxfrm="define"
+$   d_wcscmp="undef"
+$   d_wcstombs="define"
+$   d_wcsxfrm="undef"
 $   d_wctomb="define"
-$   i_locale="define"
 $   i_langinfo="define"
-$   d_locconv="define"
-$   d_nl_langinfo="define"
-$   d_setlocale="define"
+$   i_locale="define"
 $   vms_cc_type="decc"
 $ ELSE
+$   d_faststdio="undef"
+$   d_locconv="undef"
+$   d_mblen="undef"
 $   d_mbstowcs="undef"
 $   d_mbtowc="undef"
+$   d_mktime="undef"
+$   d_nl_langinfo="undef"
+$   d_setlocale="undef"
 $   d_stdiobase="undef"
 $   d_stdio_cnt_lval="undef"
 $   d_stdio_ptr_lval="undef"
 $   d_stdstdio="undef"
-$   d_faststdio="undef"
-$   d_wcstombs="undef"
-$   d_mblen="undef"
-$   d_mktime="undef"
 $   d_strcoll="undef"
 $   d_strxfrm="undef"
 $   d_wctomb="undef"
-$   i_locale="undef"
+$   d_wcscmp="undef"
+$   d_wcstombs="define"
+$   d_wcsxfrm="undef"
 $   i_langinfo="undef"
-$   d_locconv="undef"
-$   d_nl_langinfo="undef"
-$   d_setlocale="undef"
+$   i_locale="undef"
 $ ENDIF
 $ d_stdio_ptr_lval_sets_cnt="undef"
 $ d_stdio_ptr_lval_nochange_cnt="define"
@@ -6350,7 +6354,9 @@ $ WC "d_vprintf='define'"
 $ WC "d_vsnprintf='" + d_vsnprintf + "'"
 $ WC "d_wait4='" + d_wait4 + "'"
 $ WC "d_waitpid='define'"
+$ WC "d_wcscmp='" + d_wcscmp + "'"
 $ WC "d_wcstombs='" + d_wcstombs + "'"
+$ WC "d_wcsxfrm='" + d_wcsxfrm + "'"
 $ WC "d_wctomb='" + d_wctomb + "'"
 $ WC "d_writev='undef'"
 $ WC "d_xenix='undef'"
index 031a967..c5bcd6b 100644 (file)
@@ -539,7 +539,9 @@ d_vprintf='define'
 d_vsnprintf='undef'
 d_wait4='undef'
 d_waitpid='define'
+d_wcscmp=''undef''
 d_wcstombs='define'
+d_wcsxfrm=''undef''
 d_wctomb='define'
 d_writev='define'
 d_xenix='undef'
index 29482a2..e1c7d4e 100644 (file)
@@ -487,7 +487,9 @@ d_vprintf='define'
 d_vsnprintf='undef'
 d_wait4='undef'
 d_waitpid='undef'
+d_wcscmp=''undef''
 d_wcstombs='undef'
+d_wcsxfrm=''undef''
 d_wctomb='undef'
 d_writev='undef'
 d_xenix='undef'
index d827d06..13ed9ef 100644 (file)
--- a/uconfig.h
+++ b/uconfig.h
 
 /* HAS_MBSTOWCS:
  *     This symbol, if defined, indicates that the mbstowcs routine is
- *     available to covert a multibyte string into a wide character string.
+ *     available to convert a multibyte string into a wide character string.
  */
 /*#define      HAS_MBSTOWCS            / **/
 
 /* HAS_MBTOWC:
  *     This symbol, if defined, indicates that the mbtowc routine is available
- *     to covert a multibyte to a wide character.
+ *     to convert a multibyte to a wide character.
  */
 /*#define HAS_MBTOWC           / **/
 
 
 /* HAS_WCTOMB:
  *     This symbol, if defined, indicates that the wctomb routine is available
- *     to covert a wide character to a multibyte.
+ *     to convert a wide character to a multibyte.
  */
 /*#define HAS_WCTOMB           / **/
 
  */
 /*#define HAS_USTAT            / **/
 
+/* HAS_WCSCMP:
+ *     This symbol, if defined, indicates that the wcscmp routine is
+ *     available to compare two wide character strings.
+ */
+/*#define HAS_WCSCMP   / **/
+
+/* HAS_WCSXFRM:
+ *     This symbol, if defined, indicates that the wcsxfrm routine is
+ *     available to tranform a wide character string for wcscmp().
+ */
+/*#define HAS_WCSXFRM  / **/
+
 /* HAS_WRITEV:
  *     This symbol, if defined, indicates that the writev routine is
  *     available to do scatter writes.
 #endif
 
 /* Generated from:
- * 0c557b295352d0f05dcf3397478783eb763c947618aef92c2a0f86ba2540da40 config_h.SH
- * a61a38253be27e9d2b4ff63b9f34ef9c6870a03037609f2c89840ad890a7aef8 uconfig.sh
+ * 06dae33599ea14bee0e39e3b22e1f685aaae36422af2c567dc1de19203950835 config_h.SH
+ * a350679952164b71c20f5b09afd8c2ffe982e97dddffa15031edc7584b357796 uconfig.sh
  * ex: set ro: */
index ee17861..2f71d73 100644 (file)
@@ -478,7 +478,9 @@ d_vprintf='define'
 d_vsnprintf='undef'
 d_wait4='undef'
 d_waitpid='undef'
+d_wcscmp=''undef''
 d_wcstombs='undef'
+d_wcsxfrm=''undef''
 d_wctomb='undef'
 d_writev='undef'
 d_xenix='undef'
index f26a19d..ba46d14 100644 (file)
@@ -479,7 +479,9 @@ d_vprintf='define'
 d_vsnprintf='undef'
 d_wait4='undef'
 d_waitpid='undef'
+d_wcscmp=''undef''
 d_wcstombs='undef'
+d_wcsxfrm=''undef''
 d_wctomb='undef'
 d_writev='undef'
 d_xenix='undef'
index 5177beb..b8a5cd6 100644 (file)
@@ -527,7 +527,9 @@ d_vprintf='define'
 d_vsnprintf='undef'
 d_wait4='undef'
 d_waitpid='define'
+d_wcscmp=''undef''
 d_wcstombs='define'
+d_wcsxfrm=''undef''
 d_wctomb='define'
 d_writev='undef'
 d_xenix='undef'
index 39cdaef..4ad603a 100644 (file)
@@ -528,7 +528,9 @@ d_vprintf='define'
 d_vsnprintf='define'
 d_wait4='undef'
 d_waitpid='define'
+d_wcscmp=''undef''
 d_wcstombs='define'
+d_wcsxfrm=''undef''
 d_wctomb='define'
 d_writev='undef'
 d_xenix='undef'
index eef02e1..8002804 100644 (file)
@@ -528,7 +528,9 @@ d_vprintf='define'
 d_vsnprintf='define'
 d_wait4='undef'
 d_waitpid='define'
+d_wcscmp=''undef''
 d_wcstombs='define'
+d_wcsxfrm=''undef''
 d_wctomb='define'
 d_writev='undef'
 d_xenix='undef'