require '_h2ph_pre.ph';

unless(defined(&_SIMPLELOCK_H_)) {
    eval 'sub _SIMPLELOCK_H_ () {1;}' unless defined(&_SIMPLELOCK_H_);
    if(defined(&_KERNEL)) {
	unless(defined(&NCPUS)) {
	    eval 'sub NCPUS () {1;}' unless defined(&NCPUS);
	}
	eval 'sub SLOCK_LOCKED () {1;}' unless defined(&SLOCK_LOCKED);
	eval 'sub SLOCK_UNLOCKED () {0;}' unless defined(&SLOCK_UNLOCKED);
	eval 'sub SLOCK_INITIALIZER () {{  &SLOCK_UNLOCKED };}' unless defined(&SLOCK_INITIALIZER);
	if(((defined(&NCPUS) ? &NCPUS : 0) != 1)  && defined( &LOCKDEBUG)) {
	    undef(&LOCKDEBUG) if defined(&LOCKDEBUG);
	}
	if((defined(&NCPUS) ? &NCPUS : 0) == 1) {
	    unless(defined(&LOCKDEBUG)) {
		eval 'sub simple_lock {
		    local($lkp) = @_;
    		    eval q();
		}' unless defined(&simple_lock);
		eval 'sub simple_lock_try {
		    local($lkp) = @_;
    		    eval q((1));
		}' unless defined(&simple_lock_try);
		eval 'sub simple_unlock {
		    local($lkp) = @_;
    		    eval q();
		}' unless defined(&simple_unlock);
		eval 'sub simple_lock_assert {
		    local($lkp) = @_;
    		    eval q();
		}' unless defined(&simple_lock_assert);
	    } else {
		eval 'sub simple_unlock {
		    local($lkp) = @_;
    		    eval q( &_simple_unlock($lkp,  &__FILE__,  &__LINE__));
		}' unless defined(&simple_unlock);
		eval 'sub simple_lock_try {
		    local($lkp) = @_;
    		    eval q( &_simple_lock_try($lkp,  &__FILE__,  &__LINE__));
		}' unless defined(&simple_lock_try);
		eval 'sub simple_lock {
		    local($lkp) = @_;
    		    eval q( &_simple_lock($lkp,  &__FILE__,  &__LINE__));
		}' unless defined(&simple_lock);
		eval 'sub simple_lock_assert {
		    local($lkp, $state) = @_;
    		    eval q( &_simple_lock_assert($lkp, $state,  &__FILE__,  &__LINE__));
		}' unless defined(&simple_lock_assert);
	    }
	} else {
	}
    }
}
1;
