This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
metaconfig: more paranoid _r protochecking.
[metaconfig.git] / U / threads / d_ctime_r.U
index c30f5d3..4ba782d 100644 (file)
@@ -6,7 +6,7 @@
 ?RCS:
 ?RCS: Generated by the reentr.pl from the Perl 5.8 distribution.
 ?RCS:
-?MAKE:d_ctime_r ctime_r_proto: Inlibc Protochk i_systypes i_time
+?MAKE:d_ctime_r ctime_r_proto: Inlibc Protochk Hasproto i_systypes i_time
 ?MAKE: -pick add $@ %<
 ?S:d_ctime_r:
 ?S:    This variable conditionally defines the HAS_CTIME_R symbol,
@@ -26,7 +26,7 @@
 ?H:#$d_ctime_r HAS_CTIME_R        /**/
 ?H:#define CTIME_R_PROTO $ctime_r_proto           /**/
 ?H:.
-?T:try hdrs
+?T:try hdrs d_ctime_r_proto
 ?LINT:set d_ctime_r
 ?LINT:set ctime_r_proto
 : see if ctime_r exists
@@ -35,6 +35,14 @@ eval $inlibc
 case "$d_ctime_r" in
 "$define")
        hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h"
+       case "$d_ctime_r_proto" in
+       '')     d_ctime_r_proto=define
+               set d_ctime_r_proto ctime_r $hdrs
+               eval $hasproto ;;
+       *)      ;;
+       esac
+       case "$d_ctime_r_proto" in
+       define)
        case "$ctime_r_proto" in
        ''|0) try='char* ctime_r(const time_t*, char*);'
        ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
@@ -54,7 +62,7 @@ case "$d_ctime_r" in
        case "$ctime_r_proto" in
        '')     d_ctime_r=undef
                ctime_r_proto=0
-               echo "Disabling ctime_r, cannot determine prototype." ;;
+               echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
        * )     case "$ctime_r_proto" in
                REENTRANT_PROTO*) ;;
                *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
@@ -62,6 +70,9 @@ case "$d_ctime_r" in
                echo "Prototype: $try" ;;
        esac
        ;;
+       *)      echo "You have ctime_r but no prototype, not using it." >&4 ;;
+       esac
+       ;;
 *)     ctime_r_proto=0
        ;;
 esac