require '_h2ph_pre.ph';

unless(defined(&_BITS_STDIO_LOCK_H)) {
    eval 'sub _BITS_STDIO_LOCK_H () {1;}' unless defined(&_BITS_STDIO_LOCK_H);
    require 'bits/libc-lock.ph';
    if(defined(&_LIBC_LOCK_RECURSIVE_INITIALIZER)) {
	eval 'sub _IO_lock_initializer () { &_LIBC_LOCK_RECURSIVE_INITIALIZER;}' unless defined(&_IO_lock_initializer);
    }
 elsif((defined(&_IO_MTSAFE_IO) ? &_IO_MTSAFE_IO : 0)) {
	die("libio\ needs\ recursive\ mutexes\ for\ _IO_MTSAFE_IO");
    }
    eval 'sub _IO_lock_init {
        local($_name) = @_;
	    eval q( &__libc_lock_init_recursive ($_name));
    }' unless defined(&_IO_lock_init);
    eval 'sub _IO_lock_fini {
        local($_name) = @_;
	    eval q( &__libc_lock_fini_recursive ($_name));
    }' unless defined(&_IO_lock_fini);
    eval 'sub _IO_lock_lock {
        local($_name) = @_;
	    eval q( &__libc_lock_lock_recursive ($_name));
    }' unless defined(&_IO_lock_lock);
    eval 'sub _IO_lock_trylock {
        local($_name) = @_;
	    eval q( &__libc_lock_trylock_recursive ($_name));
    }' unless defined(&_IO_lock_trylock);
    eval 'sub _IO_lock_unlock {
        local($_name) = @_;
	    eval q( &__libc_lock_unlock_recursive ($_name));
    }' unless defined(&_IO_lock_unlock);
    eval 'sub _IO_cleanup_region_start {
        local($_fct, $_fp) = @_;
	    eval q( &__libc_cleanup_region_start ((($_fp)-> &_flags &  &_IO_USER_LOCK) == 0, $_fct, $_fp));
    }' unless defined(&_IO_cleanup_region_start);
    eval 'sub _IO_cleanup_region_start_noarg {
        local($_fct) = @_;
	    eval q( &__libc_cleanup_region_start (1, $_fct,  &NULL));
    }' unless defined(&_IO_cleanup_region_start_noarg);
    eval 'sub _IO_cleanup_region_end {
        local($_doit) = @_;
	    eval q( &__libc_cleanup_region_end ($_doit));
    }' unless defined(&_IO_cleanup_region_end);
}
1;
