X-Git-Url: https://perl5.git.perl.org/metaconfig.git/blobdiff_plain/cce04e58b23d5bfe393e989a60e7f73a7ccaa4ba..977977526b4e4c4555bea768e15504fd8f34f1f0:/U/threads/d_localtime_r.U diff --git a/U/threads/d_localtime_r.U b/U/threads/d_localtime_r.U index 94be218..53fa397 100644 --- a/U/threads/d_localtime_r.U +++ b/U/threads/d_localtime_r.U @@ -9,7 +9,7 @@ ?RCS: ?MAKE:d_localtime_r d_localtime_r_needs_tzset localtime_r_proto: Inlibc \ cat run Protochk Hasproto i_systypes usethreads i_time i_systime \ - rm_try Compile extern_C + rm_try Compile extern_C i_stdlib i_unistd i_malloc ?MAKE: -pick add $@ %< ?S:d_localtime_r: ?S: This variable conditionally defines the HAS_LOCALTIME_R symbol, @@ -52,8 +52,8 @@ ?C: REENTRANT_PROTO_T_ABC macros of reentr.h if d_localtime_r ?C: is defined. ?C:. -?H:#$d_localtime_r HAS_LOCALTIME_R /**/ -?H:#define LOCALTIME_R_PROTO $localtime_r_proto /**/ +?H:#$d_localtime_r HAS_LOCALTIME_R /**/ +?H:#define LOCALTIME_R_PROTO $localtime_r_proto /**/ ?H:. ?T:try hdrs d_localtime_r_proto ?F:!try @@ -81,7 +81,7 @@ case "$d_localtime_r" in esac case "$localtime_r_proto" in ''|0) d_localtime_r=undef - localtime_r_proto=0 + localtime_r_proto=0 echo "Disabling localtime_r, cannot determine prototype." >&4 ;; * ) case "$localtime_r_proto" in REENTRANT_PROTO*) ;; @@ -109,13 +109,30 @@ REENTRANT_PROTO*) /* Does our libc's localtime_r call tzset ? * return 0 if so, 1 otherwise. */ -#include -#include -#include +#$i_systypes I_SYS_TYPES +#$i_unistd I_UNISTD +#$i_time I_TIME +#$i_stdlib I_STDLIB +#$i_malloc I_MALLOC +#ifdef I_SYS_TYPES +# include +#endif +#ifdef I_UNISTD +# include +#endif +#ifdef I_TIME +# include +#endif +#ifdef I_STDLIB +#include +#endif #include -#include +#ifdef I_MALLOC +# include +#endif int main() { + int result = 0; time_t t = time(0L); char w_tz[]="TZ" "=GMT+5", e_tz[]="TZ" "=GMT-5", @@ -134,8 +151,10 @@ int main() localtime_r(&t, &tm_w); if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 ) - return 1; - return 0; + result = 1; + + free(tz_e);free(tz_w); + return result; } EOCP set try