This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix .gitignore: only ignore 'perl' in root of repo, not U/perl subdir
[metaconfig.git] / U / perl / d_wcsxfrm.U
CommitLineData
d0ec185f
MBT
1?RCS: Copyright (c) 2014-2014, Karl Williamson & H.Merijn Brand
2?RCS:
3?RCS: You may redistribute only under the terms of the Artistic License,
4?RCS: as specified in the README file that comes with the distribution.
5?RCS: You may reuse parts of this distribution only within the terms of
6?RCS: that same Artistic License; a copy of which may be found at the root
7?RCS: of the source tree for dist 3.0.
8?RCS:
9?MAKE:d_wcsxfrm: Compile cat rm_try run Oldconfig Setvar
10?MAKE: -pick add $@ %<
11?S:d_wcsxfrm:
12?S: This variable conditionally defines the HAS_WCSXFRM symbol if the
13?S: wcsxfrm() routine is available and can be used to compare wide
14?S: character strings.
15?S:.
16?C:HAS_WCSXFRM:
17?C: This symbol, if defined, indicates that the wcsxfrm routine is
18?C: available to tranform a wide character string for wcscmp().
19?C:.
20?H:#$d_wcsxfrm HAS_WCSXFRM /**/
21?H:.
22?F:!try
23?LINT: set d_wcsxfrm
24: look for wcsxfrm
25echo " "
26$cat >try.c <<'EOCP'
27#include <errno.h>
28#include <wchar.h>
29int main ()
30{
31 wchar_t dst[4], *src = L" ";
32 errno = 0;
33 return (wcsxfrm (dst, src, 1) ? errno ? errno : 0 : 1);
34 }
35EOCP
36set try
37?X: if $cc $ccflags $ldflags -o try try.c $libs >/dev/null 2>&1 ; then
38val="$undef"
39if eval $compile; then
40 `$run ./try`
41 case "$?" in
42 0) echo "A working wcsxfrm() found." >&4
43 val="$define" ;;
44 *) echo "wcsxfrm() found, but it doesn't work" >&4
45 ;;
46 esac
47else
48 echo "wcsxfrm() NOT found." >&4
49 fi
50set d_wcsxfrm
51eval $setvar
52$rm_try
53