This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
metaconfig: new round of the _r units.
[metaconfig.git] / U / threads / d_localtime_r.U
1 ?MAKE:d_localtime_r localtime_r_proto: Inlibc Protochk i_systypes i_time
2 ?MAKE:  -pick add $@ %<
3 ?S:d_localtime_r:
4 ?S:     This variable conditionally defines the HAS_LOCALTIME_R symbol,
5 ?S:     which indicates to the C program that the localtime_r()
6 ?S:     routine is available.
7 ?S:.
8 ?S:localtime_r_proto:
9 ?S:     This variable encodes the prototype of localtime_r.
10 ?S:.
11 ?C:HAS_LOCALTIME_R:
12 ?C:     This symbol, if defined, indicates that the localtime_r routine
13 ?C:     is available to localtime re-entrantly.
14 ?C:.
15 ?C:LOCALTIME_R_PROTO:
16 ?C:     This symbol encodes the prototype of localtime_r.
17 ?C:.
18 ?H:#$d_localtime_r HAS_LOCALTIME_R         /**/
19 ?H:#define LOCALTIME_R_PROTO $localtime_r_proto    /**/
20 ?H:.
21 ?T:try hdrs
22 ?LINT:set d_localtime_r
23 ?LINT:set localtime_r_proto
24 : see if localtime_r exists
25 set localtime_r d_localtime_r
26 eval $inlibc
27 case "$d_localtime_r" in
28 "$define")
29         hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h"
30         case "$localtime_r_proto" in
31         '') try='struct tm* localtime_r(const time_t*, struct tm*);'
32         ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
33         esac
34         case "$localtime_r_proto" in
35         '') try='int localtime_r(const time_t*, struct tm*);'
36         ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
37         esac
38         case "$localtime_r_proto" in
39         '')     d_localtime_r=undef
40                 echo "Disabling localtime_r, cannot determine prototype." ;;
41         * )     case "$localtime_r_proto" in
42                 REENTRANT_PROTO*) ;;
43                 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
44                 esac
45                 echo "Prototype: $try" ;;
46         esac
47         ;;
48 esac
49