require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_EVUTIL_H_)) {
    eval 'sub _EVUTIL_H_ () {1;}' unless defined(&_EVUTIL_H_);
    if(defined(&__cplusplus)) {
    }
    require 'sys/types.ph';
    require 'sys/time.ph';
    require 'inttypes.ph';
    require 'stdarg.ph';
    require 'stdint.ph';
    eval 'sub ev_uint64_t () { &uint64_t;}' unless defined(&ev_uint64_t);
    eval 'sub ev_int64_t () { &int64_t;}' unless defined(&ev_int64_t);
    eval 'sub ev_uint32_t () { &uint32_t;}' unless defined(&ev_uint32_t);
    eval 'sub ev_uint16_t () { &uint16_t;}' unless defined(&ev_uint16_t);
    eval 'sub ev_uint8_t () { &uint8_t;}' unless defined(&ev_uint8_t);
    eval 'sub EVUTIL_CLOSESOCKET {
        my($s) = @_;
	    eval q( &close($s));
    }' unless defined(&EVUTIL_CLOSESOCKET);
    eval 'sub EVUTIL_SOCKET_ERROR () {
        eval q(( &errno));
    }' unless defined(&EVUTIL_SOCKET_ERROR);
    eval 'sub EVUTIL_SET_SOCKET_ERROR {
        my($errcode) = @_;
	    eval q( &do {  &errno = ($errcode); }  &while (0));
    }' unless defined(&EVUTIL_SET_SOCKET_ERROR);
    eval 'sub evutil_timeradd {
        my($tvp, $uvp, $vvp) = @_;
	    eval q( &timeradd(($tvp), ($uvp), ($vvp)));
    }' unless defined(&evutil_timeradd);
    eval 'sub evutil_timersub {
        my($tvp, $uvp, $vvp) = @_;
	    eval q( &timersub(($tvp), ($uvp), ($vvp)));
    }' unless defined(&evutil_timersub);
    eval 'sub evutil_timerclear {
        my($tvp) = @_;
	    eval q( &timerclear($tvp));
    }' unless defined(&evutil_timerclear);
    eval 'sub evutil_timercmp {
        my($tvp, $uvp, $cmp) = @_;
	    eval q( &timercmp(($tvp), ($uvp), $cmp));
    }' unless defined(&evutil_timercmp);
    eval 'sub evutil_timerisset {
        my($tvp) = @_;
	    eval q( &timerisset($tvp));
    }' unless defined(&evutil_timerisset);
    eval 'sub evutil_gettimeofday {
        my($tv, $tz) = @_;
	    eval q( &gettimeofday(($tv), ($tz)));
    }' unless defined(&evutil_gettimeofday);
    if(defined(&__GNUC__)) {
    }
    if(defined(&__cplusplus)) {
    }
}
1;
