require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_UVM_UVM_STAT_H_)) {
    eval 'sub _UVM_UVM_STAT_H_ () {1;}' unless defined(&_UVM_UVM_STAT_H_);
    if(defined(&_KERNEL_OPT)) {
	require './uvm/opt_uvmhist.ph';
	require './uvm/opt_kernhist.ph';
    }
    if(defined(&UVMHIST_PRINT)  && !defined(&KERNHIST_PRINT)) {
	eval 'sub KERNHIST_PRINT () {1;}' unless defined(&KERNHIST_PRINT);
    }
    require 'sys/kernhist.ph';
    if(defined(&UVMHIST)) {
	eval 'sub UVMHIST_DECL {
	    my($NAME) = @_;
    	    eval q( &KERNHIST_DECL($NAME));
	}' unless defined(&UVMHIST_DECL);
	eval 'sub UVMHIST_DEFINE {
	    my($NAME) = @_;
    	    eval q( &KERNHIST_DEFINE($NAME));
	}' unless defined(&UVMHIST_DEFINE);
	eval 'sub UVMHIST_INIT {
	    my($NAME,$N) = @_;
    	    eval q( &KERNHIST_INIT($NAME,$N));
	}' unless defined(&UVMHIST_INIT);
	eval 'sub UVMHIST_INITIALIZER {
	    my($NAME,$BUF) = @_;
    	    eval q( &KERNHIST_INITIALIZER($NAME,$BUF));
	}' unless defined(&UVMHIST_INITIALIZER);
	eval 'sub UVMHIST_LINK_STATIC {
	    my($NAME) = @_;
    	    eval q( &KERNHIST_LINK_STATIC($NAME));
	}' unless defined(&UVMHIST_LINK_STATIC);
	eval 'sub UVMHIST_LOG {
	    my($NAME,$FMT,$A,$B,$C,$D) = @_;
    	    eval q( &KERNHIST_LOG($NAME,$FMT,$A,$B,$C,$D));
	}' unless defined(&UVMHIST_LOG);
	eval 'sub UVMHIST_CALLED {
	    my($NAME) = @_;
    	    eval q( &KERNHIST_CALLED($NAME));
	}' unless defined(&UVMHIST_CALLED);
	eval 'sub UVMHIST_CALLARGS {
	    my($NAME,$FMT,$A,$B,$C,$D) = @_;
    	    eval q( &KERNHIST_CALLARGS($NAME,$FMT,$A,$B,$C,$D));
	}' unless defined(&UVMHIST_CALLARGS);
	eval 'sub UVMHIST_FUNC {
	    my($FNAME) = @_;
    	    eval q( &KERNHIST_FUNC($FNAME));
	}' unless defined(&UVMHIST_FUNC);
    } else {
	eval 'sub UVMHIST_DECL {
	    my($NAME) = @_;
    	    eval q();
	}' unless defined(&UVMHIST_DECL);
	eval 'sub UVMHIST_DEFINE {
	    my($NAME) = @_;
    	    eval q();
	}' unless defined(&UVMHIST_DEFINE);
	eval 'sub UVMHIST_INIT {
	    my($NAME,$N) = @_;
    	    eval q();
	}' unless defined(&UVMHIST_INIT);
	eval 'sub UVMHIST_INITIALIZER {
	    my($NAME,$BUF) = @_;
    	    eval q();
	}' unless defined(&UVMHIST_INITIALIZER);
	eval 'sub UVMHIST_LINK_STATIC {
	    my($NAME) = @_;
    	    eval q();
	}' unless defined(&UVMHIST_LINK_STATIC);
	eval 'sub UVMHIST_LOG {
	    my($NAME,$FMT,$A,$B,$C,$D) = @_;
    	    eval q();
	}' unless defined(&UVMHIST_LOG);
	eval 'sub UVMHIST_CALLED {
	    my($NAME) = @_;
    	    eval q();
	}' unless defined(&UVMHIST_CALLED);
	eval 'sub UVMHIST_CALLARGS {
	    my($NAME,$FMT,$A,$B,$C,$D) = @_;
    	    eval q();
	}' unless defined(&UVMHIST_CALLARGS);
	eval 'sub UVMHIST_FUNC {
	    my($FNAME) = @_;
    	    eval q();
	}' unless defined(&UVMHIST_FUNC);
    }
}
1;
