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_ctime_r.U
index 9c7167e..ac2cf0f 100644 (file)
@@ -1,4 +1,4 @@
-?MAKE:d_ctime_r ctime_r_proto: Inlibc Protochk i_systypes i_unistd
+?MAKE:d_ctime_r ctime_r_proto: Inlibc Protochk i_systypes i_time
 ?MAKE: -pick add $@ %<
 ?S:d_ctime_r:
 ?S:    This variable conditionally defines the HAS_CTIME_R symbol,
@@ -26,30 +26,31 @@ set ctime_r d_ctime_r
 eval $inlibc
 case "$d_ctime_r" in
 "$define")
-       hdrs="$i_systypes sys/types.h $i_unistd unistd.h"
+       hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h"
        case "$ctime_r_proto" in
-       '')     try='extern char* ctime_r(const time_t*, char*);'
-               ./protochk "$try" $hdrs && ctime_r_proto=B_SB;
-       ;;
+       '') try='char* ctime_r(const time_t*, char*);'
+       ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
        esac
        case "$ctime_r_proto" in
-       '')     try='extern char* ctime_r(const time_t*, char*, int);'
-               ./protochk "$try" $hdrs && ctime_r_proto=B_SBI;
-       ;;
+       '') try='char* ctime_r(const time_t*, char*, int);'
+       ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
        esac
        case "$ctime_r_proto" in
-       '')     try='extern int ctime_r(const time_t*, char*);'
-               ./protochk "$try" $hdrs && ctime_r_proto=I_SB;
-       ;;
+       '') try='int ctime_r(const time_t*, char*);'
+       ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
        esac
        case "$ctime_r_proto" in
-       '')     try='extern int ctime_r(const time_t*, char*, int);'
-               ./protochk "$try" $hdrs && ctime_r_proto=I_SBI;
-       ;;
+       '') try='int ctime_r(const time_t*, char*, int);'
+       ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
        esac
        case "$ctime_r_proto" in
-       '') d_ctime_r=undef ; echo "Disabling ctime_r, cannot find prototype." ;;
-       * ) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ; echo "$try" ;;
+       '')     d_ctime_r=undef
+               echo "Disabling ctime_r, cannot determine prototype." ;;
+       * )     case "$ctime_r_proto" in
+               REENTRANT_PROTO*) ;;
+               *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
+               esac
+               echo "Prototype: $try" ;;
        esac
        ;;
 esac