require '_h2ph_pre.ph';

unless(defined(&_PTHREAD_H_)) {
    eval 'sub _PTHREAD_H_ () {1;}' unless defined(&_PTHREAD_H_);
    if(defined(&_POSIX_THREADS)) {
	require 'sys/cdefs.ph';
	require 'sys/types.ph';
	require 'sys/time.ph';
	require 'sys/signal.ph';
	require 'limits.ph';
	require 'sched.ph';
	eval 'sub PTHREAD_DESTRUCTOR_ITERATIONS () {4;}' unless defined(&PTHREAD_DESTRUCTOR_ITERATIONS);
	eval 'sub PTHREAD_KEYS_MAX () {256;}' unless defined(&PTHREAD_KEYS_MAX);
	eval 'sub PTHREAD_STACK_MIN () {1024;}' unless defined(&PTHREAD_STACK_MIN);
	eval 'sub PTHREAD_THREADS_MAX () { &ULONG_MAX;}' unless defined(&PTHREAD_THREADS_MAX);
	eval 'sub _POSIX_THREAD_ATTR_STACKADDR () {1;}' unless defined(&_POSIX_THREAD_ATTR_STACKADDR);
	eval 'sub _POSIX_THREAD_ATTR_STACKSIZE () {1;}' unless defined(&_POSIX_THREAD_ATTR_STACKSIZE);
	eval 'sub _POSIX_THREAD_PRIORITY_SCHEDULING () {1;}' unless defined(&_POSIX_THREAD_PRIORITY_SCHEDULING);
	eval 'sub _POSIX_THREAD_PRIO_INHERIT () {1;}' unless defined(&_POSIX_THREAD_PRIO_INHERIT);
	eval 'sub _POSIX_THREAD_PRIO_PROTECT () {1;}' unless defined(&_POSIX_THREAD_PRIO_PROTECT);
	eval 'sub _POSIX_THREAD_SAFE_FUNCTIONS () {1;}' unless defined(&_POSIX_THREAD_SAFE_FUNCTIONS);
	eval 'sub PTHREAD_DETACHED () {0x1;}' unless defined(&PTHREAD_DETACHED);
	eval 'sub PTHREAD_SCOPE_SYSTEM () {0x2;}' unless defined(&PTHREAD_SCOPE_SYSTEM);
	eval 'sub PTHREAD_INHERIT_SCHED () {0x4;}' unless defined(&PTHREAD_INHERIT_SCHED);
	eval 'sub PTHREAD_NOFLOAT () {0x8;}' unless defined(&PTHREAD_NOFLOAT);
	eval 'sub PTHREAD_CREATE_DETACHED () { &PTHREAD_DETACHED;}' unless defined(&PTHREAD_CREATE_DETACHED);
	eval 'sub PTHREAD_CREATE_JOINABLE () {0;}' unless defined(&PTHREAD_CREATE_JOINABLE);
	eval 'sub PTHREAD_SCOPE_PROCESS () {0;}' unless defined(&PTHREAD_SCOPE_PROCESS);
	eval 'sub PTHREAD_EXPLICIT_SCHED () {0;}' unless defined(&PTHREAD_EXPLICIT_SCHED);
	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_ENABLE () {0;}' unless defined(&PTHREAD_CANCEL_ENABLE);
	eval 'sub PTHREAD_CANCEL_DISABLE () {1;}' unless defined(&PTHREAD_CANCEL_DISABLE);
	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_CANCELED () {( 1);}' unless defined(&PTHREAD_CANCELED);
	eval 'sub PTHREAD_NEEDS_INIT () {0;}' unless defined(&PTHREAD_NEEDS_INIT);
	eval 'sub PTHREAD_DONE_INIT () {1;}' unless defined(&PTHREAD_DONE_INIT);
	eval 'sub PTHREAD_ONCE_INIT () {{  &PTHREAD_NEEDS_INIT,  &PTHREAD_MUTEX_INITIALIZER };}' unless defined(&PTHREAD_ONCE_INIT);
	eval 'sub PTHREAD_MUTEX_INITIALIZER () { &NULL;}' unless defined(&PTHREAD_MUTEX_INITIALIZER);
	eval 'sub PTHREAD_COND_INITIALIZER () { &NULL;}' unless defined(&PTHREAD_COND_INITIALIZER);
	eval 'sub PTHREAD_RWLOCK_INITIALIZER () { &NULL;}' unless defined(&PTHREAD_RWLOCK_INITIALIZER);
	eval 'sub PTHREAD_PRIO_NONE () {0;}' unless defined(&PTHREAD_PRIO_NONE);
	if(defined(&_POSIX_THREAD_PRIO_PROTECT)) {
	    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_MUTEX_ERRORCHECK () { 1; }") unless defined(&PTHREAD_MUTEX_ERRORCHECK);
	eval("sub PTHREAD_MUTEX_RECURSIVE () { 2; }") unless defined(&PTHREAD_MUTEX_RECURSIVE);
	eval("sub PTHREAD_MUTEX_NORMAL () { 3; }") unless defined(&PTHREAD_MUTEX_NORMAL);
	eval("sub MUTEX_TYPE_MAX () { 4; }") unless defined(&MUTEX_TYPE_MAX);
	eval 'sub PTHREAD_MUTEX_DEFAULT () { &PTHREAD_MUTEX_ERRORCHECK;}' unless defined(&PTHREAD_MUTEX_DEFAULT);
	eval 'sub MUTEX_TYPE_FAST () { &PTHREAD_MUTEX_NORMAL;}' unless defined(&MUTEX_TYPE_FAST);
	eval 'sub MUTEX_TYPE_COUNTING_FAST () { &PTHREAD_MUTEX_RECURSIVE;}' unless defined(&MUTEX_TYPE_COUNTING_FAST);
	if(defined( &_POSIX_THREAD_PROCESS_SHARED)) {
	}
	if(defined( &_POSIX_THREAD_PROCESS_SHARED)) {
	}
	if(defined( &_POSIX_THREAD_PRIO_PROTECT)) {
	}
	if(defined( &_POSIX_THREAD_PRIO_PROTECT) || defined ( &_POSIX_THREAD_PRIO_INHERIT)) {
	}
	if(defined( &_POSIX_THREAD_PRIORITY_SCHEDULING)) {
	}
	if(0) {
	    eval 'sub PTHREAD_PRIO_INHERIT () {1;}' unless defined(&PTHREAD_PRIO_INHERIT);
	    eval 'sub PTHREAD_PRIO_NONE () {1;}' unless defined(&PTHREAD_PRIO_NONE);
	    eval 'sub PTHREAD_PRIO_PROTECT () {1;}' unless defined(&PTHREAD_PRIO_PROTECT);
	}
    } else {
	warn("\"included\ \<pthread\.h\>\ without\ \-pthread\ compiler\ option\"");
    }
}
1;
