require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_GLIBCXX_GCC_GTHR_POSIX_H)) {
    eval 'sub _GLIBCXX_GCC_GTHR_POSIX_H () {1;}' unless defined(&_GLIBCXX_GCC_GTHR_POSIX_H);
    eval 'sub __GTHREADS () {1;}' unless defined(&__GTHREADS);
    if(!defined(&_REENTRANT)  && defined(&__osf__)) {
	eval 'sub _REENTRANT () {1;}' unless defined(&_REENTRANT);
    }
    require 'pthread.ph';
    require 'unistd.ph';
    eval 'sub __GTHREAD_MUTEX_INIT () { &PTHREAD_MUTEX_INITIALIZER;}' unless defined(&__GTHREAD_MUTEX_INIT);
    eval 'sub __GTHREAD_ONCE_INIT () { &PTHREAD_ONCE_INIT;}' unless defined(&__GTHREAD_ONCE_INIT);
    if(defined(&PTHREAD_RECURSIVE_MUTEX_INITIALIZER)) {
	eval 'sub __GTHREAD_RECURSIVE_MUTEX_INIT () { &PTHREAD_RECURSIVE_MUTEX_INITIALIZER;}' unless defined(&__GTHREAD_RECURSIVE_MUTEX_INIT);
    }
 elsif(defined(&PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP)) {
	eval 'sub __GTHREAD_RECURSIVE_MUTEX_INIT () { &PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;}' unless defined(&__GTHREAD_RECURSIVE_MUTEX_INIT);
    } else {
	eval 'sub __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION () { &__gthread_recursive_mutex_init_function;}' unless defined(&__GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION);
    }
    if((defined(&__GXX_WEAK__) ? &__GXX_WEAK__ : undef)  && (defined(&_GLIBCXX_GTHREAD_USE_WEAK) ? &_GLIBCXX_GTHREAD_USE_WEAK : undef)) {
	unless(defined(&__gthrw_pragma)) {
	    eval 'sub __gthrw_pragma {
	        my($pragma) = @_;
    		eval q();
	    }' unless defined(&__gthrw_pragma);
	}
	eval 'sub __gthrw2 {
	    my($name,$name2,$type) = @_;
    	    eval q( &static  &__typeof($type) $name  &__attribute__ (( &__weakref__($name2)));  &__gthrw_pragma( &weak $type));
	}' unless defined(&__gthrw2);
	eval 'sub __gthrw_ {
	    my($name) = @_;
    	    eval q( &__gthrw_  $name);
	}' unless defined(&__gthrw_);
    } else {
	eval 'sub __gthrw2 {
	    my($name,$name2,$type) = @_;
    	    eval q();
	}' unless defined(&__gthrw2);
	eval 'sub __gthrw_ {
	    my($name) = @_;
    	    eval q($name);
	}' unless defined(&__gthrw_);
    }
    eval 'sub __gthrw {
        my($name) = @_;
	    eval q( &__gthrw2( &__gthrw_  $name,$name,$name));
    }' unless defined(&__gthrw);
    if(defined(&__osf__)  && defined(&_PTHREAD_USE_MANGLED_NAMES_)) {
	eval 'sub __gthrw3 {
	    my($name) = @_;
    	    eval q( &__gthrw2( &__gthrw_  $name,  &__  $name, $name));
	}' unless defined(&__gthrw3);
    } else {
    }
    if(defined(&_LIBOBJC) || defined(&_LIBOBJC_WEAK)) {
	if(defined(&__osf__)  && defined(&_PTHREAD_USE_MANGLED_NAMES_)) {
	} else {
	}
	if(defined(&_POSIX_PRIORITY_SCHEDULING)) {
	    if(defined(&_POSIX_THREAD_PRIORITY_SCHEDULING)) {
	    }
	}
	if(defined(&_POSIX_THREAD_PRIORITY_SCHEDULING)) {
	}
    }
    if((defined(&__GXX_WEAK__) ? &__GXX_WEAK__ : undef)  && (defined(&_GLIBCXX_GTHREAD_USE_WEAK) ? &_GLIBCXX_GTHREAD_USE_WEAK : undef)) {
	if(defined(&__sun)  && defined(&__svr4__)) {
	} else {
	}
    } else {
    }
    if(defined(&_LIBOBJC)) {
	require 'config.ph';
	if(defined(&HAVE_SCHED_H)) {
	    require 'sched.ph';
	}
    } else {
	unless(defined(&PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP)) {
	}
    }
}
1;
