require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_RPC_SVC_H)) {
    eval 'sub _RPC_SVC_H () {1;}' unless defined(&_RPC_SVC_H);
    require 'sys/cdefs.ph';
    require 'sys/poll.ph';
    eval("sub XPRT_DIED () { 0; }") unless defined(&XPRT_DIED);
    eval("sub XPRT_MOREREQS () { 1; }") unless defined(&XPRT_MOREREQS);
    eval("sub XPRT_IDLE () { 2; }") unless defined(&XPRT_IDLE);
    eval 'sub svc_getcaller {
        my($x) = @_;
	    eval q((($x)-> &xp_raddr));
    }' unless defined(&svc_getcaller);
    eval 'sub SVC_RECV {
        my($xprt, $msg) = @_;
	    eval q((*($xprt)-> ($xp_ops->{xp_recv}))(($xprt), ($msg)));
    }' unless defined(&SVC_RECV);
    eval 'sub svc_recv {
        my($xprt, $msg) = @_;
	    eval q((*($xprt)-> ($xp_ops->{xp_recv}))(($xprt), ($msg)));
    }' unless defined(&svc_recv);
    eval 'sub SVC_STAT {
        my($xprt) = @_;
	    eval q((*($xprt)-> ($xp_ops->{xp_stat}))($xprt));
    }' unless defined(&SVC_STAT);
    eval 'sub svc_stat {
        my($xprt) = @_;
	    eval q((*($xprt)-> ($xp_ops->{xp_stat}))($xprt));
    }' unless defined(&svc_stat);
    eval 'sub SVC_GETARGS {
        my($xprt, $xargs, $argsp) = @_;
	    eval q((*($xprt)-> ($xp_ops->{xp_getargs}))(($xprt), ($xargs), ($argsp)));
    }' unless defined(&SVC_GETARGS);
    eval 'sub svc_getargs {
        my($xprt, $xargs, $argsp) = @_;
	    eval q((*($xprt)-> ($xp_ops->{xp_getargs}))(($xprt), ($xargs), ($argsp)));
    }' unless defined(&svc_getargs);
    eval 'sub SVC_REPLY {
        my($xprt, $msg) = @_;
	    eval q((*($xprt)-> ($xp_ops->{xp_reply})) (($xprt), ($msg)));
    }' unless defined(&SVC_REPLY);
    eval 'sub svc_reply {
        my($xprt, $msg) = @_;
	    eval q((*($xprt)-> ($xp_ops->{xp_reply})) (($xprt), ($msg)));
    }' unless defined(&svc_reply);
    eval 'sub SVC_FREEARGS {
        my($xprt, $xargs, $argsp) = @_;
	    eval q((*($xprt)-> ($xp_ops->{xp_freeargs}))(($xprt), ($xargs), ($argsp)));
    }' unless defined(&SVC_FREEARGS);
    eval 'sub svc_freeargs {
        my($xprt, $xargs, $argsp) = @_;
	    eval q((*($xprt)-> ($xp_ops->{xp_freeargs}))(($xprt), ($xargs), ($argsp)));
    }' unless defined(&svc_freeargs);
    eval 'sub SVC_DESTROY {
        my($xprt) = @_;
	    eval q((*($xprt)-> ($xp_ops->{xp_destroy}))($xprt));
    }' unless defined(&SVC_DESTROY);
    eval 'sub svc_destroy {
        my($xprt) = @_;
	    eval q((*($xprt)-> ($xp_ops->{xp_destroy}))($xprt));
    }' unless defined(&svc_destroy);
    eval 'sub svc_fds () { ($svc_fdset->{fds_bits[0]});}' unless defined(&svc_fds);
    eval 'sub RPC_ANYSOCK () {-1;}' unless defined(&RPC_ANYSOCK);
}
1;
