require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_SYS_CLOCK_H_)) {
    eval 'sub _SYS_CLOCK_H_ () {1;}' unless defined(&_SYS_CLOCK_H_);
    eval 'sub SECS_PER_MINUTE () {60;}' unless defined(&SECS_PER_MINUTE);
    eval 'sub SECS_PER_HOUR () {3600;}' unless defined(&SECS_PER_HOUR);
    eval 'sub SECS_PER_DAY () {86400;}' unless defined(&SECS_PER_DAY);
    eval 'sub DAYS_PER_COMMON_YEAR () {365;}' unless defined(&DAYS_PER_COMMON_YEAR);
    eval 'sub DAYS_PER_LEAP_YEAR () {366;}' unless defined(&DAYS_PER_LEAP_YEAR);
    eval 'sub SECS_PER_COMMON_YEAR () {( &SECS_PER_DAY *  &DAYS_PER_COMMON_YEAR);}' unless defined(&SECS_PER_COMMON_YEAR);
    eval 'sub SECS_PER_LEAP_YEAR () {( &SECS_PER_DAY *  &DAYS_PER_LEAP_YEAR);}' unless defined(&SECS_PER_LEAP_YEAR);
    eval 'sub POSIX_BASE_YEAR () {1970;}' unless defined(&POSIX_BASE_YEAR);
    eval 'sub days_per_year {
        my($year) = @_;
	    eval q({  &is_leap_year($year) ?  &DAYS_PER_LEAP_YEAR :  &DAYS_PER_COMMON_YEAR; });
    }' unless defined(&days_per_year);
}
1;
