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/_types.ph';
    unless(defined(&NULL)) {
	if(defined(&__GNUG__)) {
	    eval 'sub NULL () { &__null;}' unless defined(&NULL);
	}
 elsif(defined(&__cplusplus)) {
	    eval 'sub NULL () {0;}' unless defined(&NULL);
	} else {
	    eval 'sub NULL () {(( &void *)0);}' unless defined(&NULL);
	}
    }
    require 'stdio.ph';
    if(!defined(&_WCHAR_T_DEFINED_)  && !defined(&__cplusplus)) {
	eval 'sub _WCHAR_T_DEFINED_ () {1;}' unless defined(&_WCHAR_T_DEFINED_);
    }
    unless(defined(&_MBSTATE_T_DEFINED_)) {
	eval 'sub _MBSTATE_T_DEFINED_ () {1;}' unless defined(&_MBSTATE_T_DEFINED_);
    }
    unless(defined(&_WINT_T_DEFINED_)) {
	eval 'sub _WINT_T_DEFINED_ () {1;}' unless defined(&_WINT_T_DEFINED_);
    }
    unless(defined(&_SIZE_T_DEFINED_)) {
	eval 'sub _SIZE_T_DEFINED_ () {1;}' unless defined(&_SIZE_T_DEFINED_);
    }
    unless(defined(&WEOF)) {
	eval 'sub WEOF () {(( &wint_t)-1);}' unless defined(&WEOF);
    }
    unless(defined(&WCHAR_MIN)) {
	eval 'sub WCHAR_MIN () {(-0x7fffffff - 1);}' unless defined(&WCHAR_MIN);
    }
    unless(defined(&WCHAR_MAX)) {
	eval 'sub WCHAR_MAX () {0x7fffffff;}' unless defined(&WCHAR_MAX);
    }
    if((defined(&__POSIX_VISIBLE) ? &__POSIX_VISIBLE : undef) >= 200809) {
    }
    if((defined(&__ISO_C_VISIBLE) ? &__ISO_C_VISIBLE : undef) >= 1999) {
    }
    if((defined(&__GNUC__)  && (defined(&__GNUC__) ? &__GNUC__ : undef) >= 2 && !defined(&__STRICT_ANSI__)) || (defined(&__ISO_C_VISIBLE) ? &__ISO_C_VISIBLE : undef) >= 1999) {
    }
    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);
}
1;
