require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_WCHAR_H_)) {
    eval 'sub _WCHAR_H_ () {1;}' unless defined(&_WCHAR_H_);
    require 'sys/cdefs.ph';
    require 'sys/featuretest.ph';
    require 'machine/wchar_limits.ph';
    require 'sys/ansi.ph';
    require 'sys/null.ph';
    require 'stdio.ph';
    if(defined(&_BSD_WCHAR_T_)  && !defined(&__cplusplus)) {
	undef(&_BSD_WCHAR_T_) if defined(&_BSD_WCHAR_T_);
    }
    if(defined(&_BSD_MBSTATE_T_)) {
	undef(&_BSD_MBSTATE_T_) if defined(&_BSD_MBSTATE_T_);
    }
    if(defined(&_BSD_WINT_T_)) {
	undef(&_BSD_WINT_T_) if defined(&_BSD_WINT_T_);
    }
    if(defined(&_BSD_SIZE_T_)) {
	undef(&_BSD_SIZE_T_) if defined(&_BSD_SIZE_T_);
    }
    if(defined(&_POSIX_C_SOURCE)) {
	unless(defined(&__VA_LIST_DECLARED)) {
	    eval 'sub __VA_LIST_DECLARED () {1;}' unless defined(&__VA_LIST_DECLARED);
	}
    }
    if(defined(&_NETBSD_SOURCE)) {
    }
    if(defined(&_NETBSD_SOURCE) || ((defined(&_POSIX_C_SOURCE) ? &_POSIX_C_SOURCE : undef) - 0>= 200112) || ((defined(&_XOPEN_SOURCE) ? &_XOPEN_SOURCE : undef) - 0) >= 600) {
    }
    if(defined(&_ISOC99_SOURCE) || ((defined(&__STDC_VERSION__) ? &__STDC_VERSION__ : undef) - 0) >= 199901 || ((defined(&__cplusplus) ? &__cplusplus : undef) - 0) >= 201103 || defined(&_NETBSD_SOURCE) || ((defined(&_POSIX_C_SOURCE) ? &_POSIX_C_SOURCE : undef) - 0) >= 200112 || ((defined(&_XOPEN_SOURCE) ? &_XOPEN_SOURCE : undef) - 0) >= 600) {
    }
    if(((defined(&_POSIX_C_SOURCE) ? &_POSIX_C_SOURCE : undef) - 0) >= 200809 || ((defined(&_XOPEN_SOURCE) ? &_XOPEN_SOURCE : undef) - 0) >= 700|| defined(&_NETBSD_SOURCE)) {
    }
    if(defined(&_ISOC99_SOURCE) || ((defined(&__STDC_VERSION__) ? &__STDC_VERSION__ : undef) - 0) > 199901 || ((defined(&__cplusplus) ? &__cplusplus : undef) - 0) >= 201103 || defined(&_NETBSD_SOURCE) || ((defined(&_POSIX_C_SOURCE) ? &_POSIX_C_SOURCE : undef) - 0) >= 200112 || ((defined(&_XOPEN_SOURCE) ? &_XOPEN_SOURCE : undef) - 0) >= 600) {
    }
    if(defined(&_NETBSD_SOURCE)) {
    }
    unless(defined(&WEOF)) {
	eval 'sub WEOF () {(( &wint_t)-1);}' unless defined(&WEOF);
    }
    eval 'sub getwc {
        my($f) = @_;
	    eval q( &fgetwc($f));
    }' unless defined(&getwc);
    eval 'sub getwchar () {
        eval q( &getwc( &stdin));
    }' unless defined(&getwchar);
    eval 'sub putwc {
        my($wc, $f) = @_;
	    eval q( &fputwc(($wc), ($f)));
    }' unless defined(&putwc);
    eval 'sub putwchar {
        my($wc) = @_;
	    eval q( &putwc(($wc),  &stdout));
    }' unless defined(&putwchar);
    if(((defined(&_POSIX_C_SOURCE) ? &_POSIX_C_SOURCE : undef) - 0) >= 200809 || defined(&_NETBSD_SOURCE)) {
	unless(defined(&__LOCALE_T_DECLARED)) {
	    eval 'sub __LOCALE_T_DECLARED () {1;}' unless defined(&__LOCALE_T_DECLARED);
	}
    }
    if(defined(&_NETBSD_SOURCE)) {
    }
}
1;
