require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&__MUSYCCVAR_H__)) {
    eval 'sub __MUSYCCVAR_H__ () {1;}' unless defined(&__MUSYCCVAR_H__);
    require 'sys/queue.ph';
    eval 'sub PPP_HEADER_LEN () {4;}' unless defined(&PPP_HEADER_LEN);
    eval 'sub MUSYCC_NUMCHAN () {32;}' unless defined(&MUSYCC_NUMCHAN);
    eval 'sub MUSYCC_NUMPORT () {8;}' unless defined(&MUSYCC_NUMPORT);
    eval 'sub MUSYCC_SREQNUM () {16;}' unless defined(&MUSYCC_SREQNUM);
    eval 'sub MUSYCC_SREQMASK () {( &MUSYCC_SREQNUM - 1);}' unless defined(&MUSYCC_SREQMASK);
    eval 'sub MUSYCC_SREQTIMEOUT () {2;}' unless defined(&MUSYCC_SREQTIMEOUT);
    eval 'sub MUSYCC_DMA_CNT () {256;}' unless defined(&MUSYCC_DMA_CNT);
    eval 'sub MUSYCC_DMA_MAPSIZE () {( &MUSYCC_DMA_CNT * $sizeof{\'struct dma_desc\'});}' unless defined(&MUSYCC_DMA_MAPSIZE);
    eval 'sub MUSYCC_DMA_SIZE () {32;}' unless defined(&MUSYCC_DMA_SIZE);
    eval 'sub MUSYCC_INTLEN () {512;}' unless defined(&MUSYCC_INTLEN);
    eval("sub CHAN_FLOAT () { 0; }") unless defined(&CHAN_FLOAT);
    eval("sub CHAN_IDLE () { 1; }") unless defined(&CHAN_IDLE);
    eval("sub CHAN_RUNNING () { 2; }") unless defined(&CHAN_RUNNING);
    eval("sub CHAN_FAULT () { 3; }") unless defined(&CHAN_FAULT);
    eval("sub CHAN_TRANSIENT () { 4; }") unless defined(&CHAN_TRANSIENT);
    eval("sub EV_NULL () { 0; }") unless defined(&EV_NULL);
    eval("sub EV_ACTIVATE () { 1; }") unless defined(&EV_ACTIVATE);
    eval("sub EV_STOP () { 2; }") unless defined(&EV_STOP);
    eval("sub EV_IDLE () { 3; }") unless defined(&EV_IDLE);
    eval("sub EV_WATCHDOG () { 4; }") unless defined(&EV_WATCHDOG);
    eval 'sub MUSYCC_LED_GREEN () {0x1;}' unless defined(&MUSYCC_LED_GREEN);
    eval 'sub MUSYCC_LED_RED () {0x2;}' unless defined(&MUSYCC_LED_RED);
    eval 'sub MUSYCC_LED_MASK () {0x3;}' unless defined(&MUSYCC_LED_MASK);
    unless(defined(&ACCOOM_DEBUG)) {
	eval 'sub ACCOOM_PRINTF {
	    my($n, $x) = @_;
    	    eval q();
	}' unless defined(&ACCOOM_PRINTF);
    } else {
	eval 'sub ACCOOM_PRINTF {
	    my($n, $x) = @_;
    	    eval q( &do {  &if ( &accoom_debug >= $n)  &printf $x; }  &while (0));
	}' unless defined(&ACCOOM_PRINTF);
    }
}
1;
