require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_LIB_PTHREAD_H)) {
    eval 'sub _LIB_PTHREAD_H () {1;}' unless defined(&_LIB_PTHREAD_H);
    require 'sys/cdefs.ph';
    require 'time.ph';
    require 'sched.ph';
    require 'sys/featuretest.ph';
    require 'pthread_types.ph';
    unless(defined(&__PTHREAD_ATFORK_DECLARED)) {
	eval 'sub __PTHREAD_ATFORK_DECLARED () {1;}' unless defined(&__PTHREAD_ATFORK_DECLARED);
    }
    unless(defined(&__LIBC12_SOURCE__)) {
    }
    if(defined(&_PTHREAD_PSHARED)) {
    }
    unless(defined(&__LIBC12_SOURCE__)) {
    }
    if(defined(&_PTHREAD_PSHARED)) {
    }
    eval 'sub pthread_cleanup_push {
        my($routine, $arg) = @_;
	    eval q({ \'struct pthread_cleanup_store\'  &__store;  &pthread__cleanup_push(($routine),($arg), & &__store););
    }' unless defined(&pthread_cleanup_push);
    eval 'sub pthread_cleanup_pop {
        my($execute) = @_;
	    eval q( &pthread__cleanup_pop(($execute), & &__store); });
    }' unless defined(&pthread_cleanup_pop);
    unless(defined(&__LIBC12_SOURCE__)) {
    }
    if(defined(&_PTHREAD_PSHARED)) {
    }
    if(defined(&_PTHREAD_PSHARED)) {
    }
    if(defined(&_NETBSD_SOURCE)) {
    }
    eval 'sub PTHREAD_CREATE_JOINABLE () {0;}' unless defined(&PTHREAD_CREATE_JOINABLE);
    eval 'sub PTHREAD_CREATE_DETACHED () {1;}' unless defined(&PTHREAD_CREATE_DETACHED);
    eval 'sub PTHREAD_INHERIT_SCHED () {0;}' unless defined(&PTHREAD_INHERIT_SCHED);
    eval 'sub PTHREAD_EXPLICIT_SCHED () {1;}' unless defined(&PTHREAD_EXPLICIT_SCHED);
    eval 'sub PTHREAD_SCOPE_PROCESS () {0;}' unless defined(&PTHREAD_SCOPE_PROCESS);
    eval 'sub PTHREAD_SCOPE_SYSTEM () {1;}' unless defined(&PTHREAD_SCOPE_SYSTEM);
    eval 'sub PTHREAD_PROCESS_PRIVATE () {0;}' unless defined(&PTHREAD_PROCESS_PRIVATE);
    eval 'sub PTHREAD_PROCESS_SHARED () {1;}' unless defined(&PTHREAD_PROCESS_SHARED);
    eval 'sub PTHREAD_CANCEL_DEFERRED () {0;}' unless defined(&PTHREAD_CANCEL_DEFERRED);
    eval 'sub PTHREAD_CANCEL_ASYNCHRONOUS () {1;}' unless defined(&PTHREAD_CANCEL_ASYNCHRONOUS);
    eval 'sub PTHREAD_CANCEL_ENABLE () {0;}' unless defined(&PTHREAD_CANCEL_ENABLE);
    eval 'sub PTHREAD_CANCEL_DISABLE () {1;}' unless defined(&PTHREAD_CANCEL_DISABLE);
    eval 'sub PTHREAD_BARRIER_SERIAL_THREAD () {1234567;}' unless defined(&PTHREAD_BARRIER_SERIAL_THREAD);
    eval 'sub PTHREAD_CANCELED () {(( &void *) 1);}' unless defined(&PTHREAD_CANCELED);
    eval 'sub PTHREAD_MAX_NAMELEN_NP () {32;}' unless defined(&PTHREAD_MAX_NAMELEN_NP);
    eval 'sub PTHREAD_MUTEX_NORMAL () {0;}' unless defined(&PTHREAD_MUTEX_NORMAL);
    eval 'sub PTHREAD_MUTEX_ERRORCHECK () {1;}' unless defined(&PTHREAD_MUTEX_ERRORCHECK);
    eval 'sub PTHREAD_MUTEX_RECURSIVE () {2;}' unless defined(&PTHREAD_MUTEX_RECURSIVE);
    eval 'sub PTHREAD_MUTEX_DEFAULT () { &PTHREAD_MUTEX_NORMAL;}' unless defined(&PTHREAD_MUTEX_DEFAULT);
    eval 'sub PTHREAD_PRIO_NONE () {0;}' unless defined(&PTHREAD_PRIO_NONE);
    eval 'sub PTHREAD_PRIO_INHERIT () {1;}' unless defined(&PTHREAD_PRIO_INHERIT);
    eval 'sub PTHREAD_PRIO_PROTECT () {2;}' unless defined(&PTHREAD_PRIO_PROTECT);
    eval 'sub PTHREAD_COND_INITIALIZER () { &_PTHREAD_COND_INITIALIZER;}' unless defined(&PTHREAD_COND_INITIALIZER);
    eval 'sub PTHREAD_MUTEX_INITIALIZER () { &_PTHREAD_MUTEX_INITIALIZER;}' unless defined(&PTHREAD_MUTEX_INITIALIZER);
    eval 'sub PTHREAD_ONCE_INIT () { &_PTHREAD_ONCE_INIT;}' unless defined(&PTHREAD_ONCE_INIT);
    eval 'sub PTHREAD_RWLOCK_INITIALIZER () { &_PTHREAD_RWLOCK_INITIALIZER;}' unless defined(&PTHREAD_RWLOCK_INITIALIZER);
    eval 'sub PTHREAD_SPINLOCK_INITIALIZER () { &_PTHREAD_SPINLOCK_INITIALIZER;}' unless defined(&PTHREAD_SPINLOCK_INITIALIZER);
    unless(defined(&__LIBPTHREAD_SOURCE__)) {
	eval 'sub pthread_mutex_init () { &__libc_mutex_init;}' unless defined(&pthread_mutex_init);
	eval 'sub pthread_mutex_lock () { &__libc_mutex_lock;}' unless defined(&pthread_mutex_lock);
	eval 'sub pthread_mutex_trylock () { &__libc_mutex_trylock;}' unless defined(&pthread_mutex_trylock);
	eval 'sub pthread_mutex_unlock () { &__libc_mutex_unlock;}' unless defined(&pthread_mutex_unlock);
	eval 'sub pthread_mutex_destroy () { &__libc_mutex_destroy;}' unless defined(&pthread_mutex_destroy);
	eval 'sub pthread_mutexattr_init () { &__libc_mutexattr_init;}' unless defined(&pthread_mutexattr_init);
	eval 'sub pthread_mutexattr_settype () { &__libc_mutexattr_settype;}' unless defined(&pthread_mutexattr_settype);
	eval 'sub pthread_mutexattr_destroy () { &__libc_mutexattr_destroy;}' unless defined(&pthread_mutexattr_destroy);
	unless(defined(&__LIBC12_SOURCE__)) {
	}
	eval 'sub pthread_cond_init () { &__libc_cond_init;}' unless defined(&pthread_cond_init);
	eval 'sub pthread_cond_signal () { &__libc_cond_signal;}' unless defined(&pthread_cond_signal);
	eval 'sub pthread_cond_broadcast () { &__libc_cond_broadcast;}' unless defined(&pthread_cond_broadcast);
	eval 'sub pthread_cond_wait () { &__libc_cond_wait;}' unless defined(&pthread_cond_wait);
	eval 'sub pthread_cond_timedwait () { &__libc_cond_timedwait;}' unless defined(&pthread_cond_timedwait);
	eval 'sub pthread_cond_destroy () { &__libc_cond_destroy;}' unless defined(&pthread_cond_destroy);
	eval 'sub pthread_rwlock_init () { &__libc_rwlock_init;}' unless defined(&pthread_rwlock_init);
	eval 'sub pthread_rwlock_rdlock () { &__libc_rwlock_rdlock;}' unless defined(&pthread_rwlock_rdlock);
	eval 'sub pthread_rwlock_wrlock () { &__libc_rwlock_wrlock;}' unless defined(&pthread_rwlock_wrlock);
	eval 'sub pthread_rwlock_tryrdlock () { &__libc_rwlock_tryrdlock;}' unless defined(&pthread_rwlock_tryrdlock);
	eval 'sub pthread_rwlock_trywrlock () { &__libc_rwlock_trywrlock;}' unless defined(&pthread_rwlock_trywrlock);
	eval 'sub pthread_rwlock_unlock () { &__libc_rwlock_unlock;}' unless defined(&pthread_rwlock_unlock);
	eval 'sub pthread_rwlock_destroy () { &__libc_rwlock_destroy;}' unless defined(&pthread_rwlock_destroy);
	eval 'sub pthread_key_create () { &__libc_thr_keycreate;}' unless defined(&pthread_key_create);
	eval 'sub pthread_setspecific () { &__libc_thr_setspecific;}' unless defined(&pthread_setspecific);
	eval 'sub pthread_getspecific () { &__libc_thr_getspecific;}' unless defined(&pthread_getspecific);
	eval 'sub pthread_key_delete () { &__libc_thr_keydelete;}' unless defined(&pthread_key_delete);
	eval 'sub pthread_once () { &__libc_thr_once;}' unless defined(&pthread_once);
	eval 'sub pthread_self () { &__libc_thr_self;}' unless defined(&pthread_self);
	eval 'sub pthread_exit () { &__libc_thr_exit;}' unless defined(&pthread_exit);
	eval 'sub pthread_setcancelstate () { &__libc_thr_setcancelstate;}' unless defined(&pthread_setcancelstate);
	eval 'sub pthread_equal () { &__libc_thr_equal;}' unless defined(&pthread_equal);
	eval 'sub pthread_curcpu_np () { &__libc_thr_curcpu;}' unless defined(&pthread_curcpu_np);
    }
}
1;
