require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&SYS_RWLOCK_H)) {
    eval 'sub SYS_RWLOCK_H () {1;}' unless defined(&SYS_RWLOCK_H);
    eval 'sub RWLOCK_INITIALIZER () {{ 0};}' unless defined(&RWLOCK_INITIALIZER);
    eval 'sub RWLOCK_WAIT () {0x1;}' unless defined(&RWLOCK_WAIT);
    eval 'sub RWLOCK_WRWANT () {0x2;}' unless defined(&RWLOCK_WRWANT);
    eval 'sub RWLOCK_WRLOCK () {0x4;}' unless defined(&RWLOCK_WRLOCK);
    eval 'sub RWLOCK_MASK () {0x7;}' unless defined(&RWLOCK_MASK);
    eval 'sub RWLOCK_OWNER {
        my($rwl) = @_;
	    eval q(((($rwl)-> &rwl_owner & ~ &RWLOCK_MASK)));
    }' unless defined(&RWLOCK_OWNER);
    eval 'sub RWLOCK_READER_SHIFT () {3;}' unless defined(&RWLOCK_READER_SHIFT);
    eval 'sub RWLOCK_READ_INCR () {(1 <<  &RWLOCK_READER_SHIFT);}' unless defined(&RWLOCK_READ_INCR);
    eval 'sub RW_WRITE () {0x;}' unless defined(&RW_WRITE);
    eval 'sub RW_READ () {0x1;}' unless defined(&RW_READ);
    eval 'sub RW_OPMASK () {0x1;}' unless defined(&RW_OPMASK);
    eval 'sub RW_INTR () {0x10;}' unless defined(&RW_INTR);
    eval 'sub RW_SLEEPFAIL () {0x20;}' unless defined(&RW_SLEEPFAIL);
    eval 'sub RW_NOSLEEP () {0x40;}' unless defined(&RW_NOSLEEP);
}
1;
