This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
metaconfig unit changes in preparation of reentrancy changes.
[metaconfig.git] / U / threads / d_strerror_r.U
1 ?RCS: $Id$
2 ?RCS:
3 ?RCS: Copyright (c) 1999 Jarkko Hietaniemi
4 ?RCS:
5 ?RCS: You may distribute under the terms of either the GNU General Public
6 ?RCS: License or the Artistic License, as specified in the README file.
7 ?RCS:
8 ?MAKE:d_strerror_r strerror_r_proto: Inlibc Protochk i_systypes i_string
9 ?MAKE:  -pick add $@ %<
10 ?S:d_strerror_r:
11 ?S:     This variable conditionally defines the HAS_STRERROR_R symbol,
12 ?S:     which indicates to the C program that the strerror_r()
13 ?S:     routine is available.
14 ?S:.
15 ?S:strerror_r_proto:
16 ?S:     This variable encodes the prototype of strerror_r.
17 ?S:.
18 ?C:HAS_STRERROR_R:
19 ?C:     This symbol, if defined, indicates that the strerror_r routine
20 ?C:     is available to strerror re-entrantly.
21 ?C:.
22 ?C:STRERROR_R_PROTO:
23 ?C:     This symbol encodes the prototype of strerror_r.
24 ?C:      13     int   strerror_r(int, char *, int)
25 ?C:      14     char* strerror_r(int, char *, int)
26 ?C:      21     int   strerror_r(int, char *, size_t)
27 ?C:      22     char* strerror_r(int, char *, size_t)
28 ?C:     The 21 is preferred since it's the SUSv3/POSIX 1001.3-2001 one.
29 ?C:.
30 ?H:#$d_strerror_r HAS_STRERROR_R                /**/
31 ?H:#define STRERROR_R_PROTO $strerror_r_proto   /**/
32 ?H:.
33 ?T:try hdrs
34 ?LINT:set d_strerror_r
35 : see if strerror_r exists
36 set strerror_r d_strerror_r
37 eval $inlibc
38 case "$d_strerror_r" in
39 "$define")
40         hdrs="$i_systypes sys/types.h $i_string string.h"
41         try='extern int strerror_r(int, char*, size_t);'
42         if ./protochk $try $hdrs; then
43                 echo "Your system has $try"
44                 strerror_r_proto=21
45         else
46                 try='extern int strerror_r(int, char*, int);'
47                 if ./protochk $try $hdrs; then
48                         echo "Your system has $try"
49                         strerror_r_proto=13
50                 else
51                         try='extern char* strerror_r(int, char*, size_t);'
52                         if ./protochk $try $hdrs; then
53                                 echo "Your system has $try"
54                                 strerror_r_proto=22
55                         else
56                                 try='extern char* strerror_r(int, char*, int);'
57                                 if ./protochk $try $hdrs; then
58                                         echo "Your system has $try"
59                                         strerror_r_proto=24
60                                 else
61                                         echo "I do not recognize the prototype of your strerror_r, not using it." >&4
62                                         d_strerror_r="$undef"
63                                         strerror_r_proto=0
64                                 fi
65                         fi
66                 fi
67         fi
68         ;;
69 *)      strerror_r_proto=0 ;;
70 esac
71
72