require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_SYS_CDEFS_H_)) {
    eval 'sub _SYS_CDEFS_H_ () {1;}' unless defined(&_SYS_CDEFS_H_);
    require 'machine/cdefs.ph';
    if(defined( &__cplusplus)) {
	eval 'sub __BEGIN_DECLS () { &extern "C" {;}' unless defined(&__BEGIN_DECLS);
	eval 'sub __END_DECLS () {};}' unless defined(&__END_DECLS);
    } else {
	eval 'sub __BEGIN_DECLS () {1;}' unless defined(&__BEGIN_DECLS);
	eval 'sub __END_DECLS () {1;}' unless defined(&__END_DECLS);
    }
    if(defined(&__GNUC__)) {
	eval 'sub __GNUC_PREREQ__ {
	    my($ma, $mi) = @_;
    	    eval q((( &__GNUC__ > ($ma)) || ( &__GNUC__ == ($ma)  &&  &__GNUC_MINOR__ >= ($mi))));
	}' unless defined(&__GNUC_PREREQ__);
    } else {
	eval 'sub __GNUC_PREREQ__ {
	    my($ma, $mi) = @_;
    	    eval q(0);
	}' unless defined(&__GNUC_PREREQ__);
    }
    if(defined( &__STDC__) || defined( &__cplusplus)) {
	eval 'sub __P {
	    my($protos) = @_;
    	    eval q($protos);
	}' unless defined(&__P);
	eval 'sub __CONCAT {
	    my($x,$y) = @_;
    	    eval q($x  $y);
	}' unless defined(&__CONCAT);
	eval 'sub __STRING {
	    my($x) = @_;
    	    eval q($x);
	}' unless defined(&__STRING);
	eval 'sub __const () { &const;}' unless defined(&__const);
	eval 'sub __signed () {\'signed\';}' unless defined(&__signed);
	eval 'sub __volatile () { &volatile;}' unless defined(&__volatile);
	if(defined( &__cplusplus)) {
	    eval 'sub __inline () { &inline;}' unless defined(&__inline);
	} else {
	    if(!defined( &__GNUC__)  && !defined( &lint)) {
		eval 'sub __inline () {1;}' unless defined(&__inline);
	    }
	}
    } else {
	eval 'sub __P {
	    my($protos) = @_;
    	    eval q(());
	}' unless defined(&__P);
	eval 'sub __CONCAT {
	    my($x,$y) = @_;
    	    eval q($x $y);
	}' unless defined(&__CONCAT);
	eval 'sub __STRING {
	    my($x) = @_;
    	    eval q(\\"x\\");
	}' unless defined(&__STRING);
	if(!defined( &__GNUC__)  && !defined( &lint)) {
	    eval 'sub __const () {1;}' unless defined(&__const);
	    eval 'sub __inline () {1;}' unless defined(&__inline);
	    eval 'sub __signed () {1;}' unless defined(&__signed);
	    eval 'sub __volatile () {1;}' unless defined(&__volatile);
	}
	unless(defined(&NO_ANSI_KEYWORDS)) {
	    eval 'sub const () { &__const;}' unless defined(&const);
	    eval 'sub inline () { &__inline;}' unless defined(&inline);
	    eval 'sub signed () { &__signed;}' unless defined(&signed);
	    eval 'sub volatile () { &__volatile;}' unless defined(&volatile);
	}
    }
    if(! &__GNUC_PREREQ__(2, 5)) {
	eval 'sub __attribute__ {
	    my($x) = @_;
    	    eval q();
	}' unless defined(&__attribute__);
	if(defined( &__GNUC__)  && !defined( &__STRICT_ANSI__)) {
	    eval 'sub __dead () { &__volatile;}' unless defined(&__dead);
	    eval 'sub __pure () { &__const;}' unless defined(&__pure);
	}
 elsif(defined( &lint)) {
	    eval 'sub __dead () {1;}' unless defined(&__dead);
	}
    }
 elsif(!defined( &__STRICT_ANSI__)) {
	eval 'sub __dead () { &__attribute__(( &__noreturn__));}' unless defined(&__dead);
	eval 'sub __pure () { &__attribute__(( &__const__));}' unless defined(&__pure);
    }
    if( &__GNUC_PREREQ__(2, 96)) {
	eval 'sub __predict_true {
	    my($exp) = @_;
    	    eval q( &__builtin_expect((($exp) != 0), 1));
	}' unless defined(&__predict_true);
	eval 'sub __predict_false {
	    my($exp) = @_;
    	    eval q( &__builtin_expect((($exp) != 0), 0));
	}' unless defined(&__predict_false);
    } else {
	eval 'sub __predict_true {
	    my($exp) = @_;
    	    eval q((($exp) != 0));
	}' unless defined(&__predict_true);
	eval 'sub __predict_false {
	    my($exp) = @_;
    	    eval q((($exp) != 0));
	}' unless defined(&__predict_false);
    }
    unless(defined(&__dead)) {
	eval 'sub __dead () {1;}' unless defined(&__dead);
	eval 'sub __pure () {1;}' unless defined(&__pure);
    }
    if( &__GNUC_PREREQ__(2, 7)) {
	eval 'sub __packed () { &__attribute__(( &__packed__));}' unless defined(&__packed);
    }
 elsif(defined( &lint)) {
	eval 'sub __packed () {1;}' unless defined(&__packed);
    }
    if(! &__GNUC_PREREQ__(2, 8)) {
	eval 'sub __extension__ () {1;}' unless defined(&__extension__);
    }
    if( &__GNUC_PREREQ__(2, 8)) {
	eval 'sub __statement {
	    my($x) = @_;
    	    eval q( &__extension__($x));
	}' unless defined(&__statement);
    }
 elsif(defined( &lint)) {
	eval 'sub __statement {
	    my($x) = @_;
    	    eval q((0));
	}' unless defined(&__statement);
    } else {
	eval 'sub __statement {
	    my($x) = @_;
    	    eval q(($x));
	}' unless defined(&__statement);
    }
    if( &__GNUC_PREREQ__(3, 0)) {
	eval 'sub __malloc () { &__attribute__(( &__malloc__));}' unless defined(&__malloc);
    } else {
	eval 'sub __malloc () {1;}' unless defined(&__malloc);
    }
    if(defined(&_XOPEN_SOURCE)) {
	if(((defined(&_XOPEN_SOURCE) ? &_XOPEN_SOURCE : 0) - 0>= 600)) {
	    eval 'sub __XPG_VISIBLE () {600;}' unless defined(&__XPG_VISIBLE);
	    undef(&_POSIX_C_SOURCE) if defined(&_POSIX_C_SOURCE);
	    eval 'sub _POSIX_C_SOURCE () {200112;}' unless defined(&_POSIX_C_SOURCE);
	}
 elsif(((defined(&_XOPEN_SOURCE) ? &_XOPEN_SOURCE : 0) - 0>= 520)) {
	    eval 'sub __XPG_VISIBLE () {520;}' unless defined(&__XPG_VISIBLE);
	    undef(&_POSIX_C_SOURCE) if defined(&_POSIX_C_SOURCE);
	    eval 'sub _POSIX_C_SOURCE () {199506;}' unless defined(&_POSIX_C_SOURCE);
	}
 elsif(((defined(&_XOPEN_SOURCE) ? &_XOPEN_SOURCE : 0) - 0>= 500)) {
	    eval 'sub __XPG_VISIBLE () {500;}' unless defined(&__XPG_VISIBLE);
	    undef(&_POSIX_C_SOURCE) if defined(&_POSIX_C_SOURCE);
	    eval 'sub _POSIX_C_SOURCE () {199506;}' unless defined(&_POSIX_C_SOURCE);
	}
 elsif(((defined(&_XOPEN_SOURCE_EXTENDED) ? &_XOPEN_SOURCE_EXTENDED : 0) - 0== 1)) {
	    eval 'sub __XPG_VISIBLE () {420;}' unless defined(&__XPG_VISIBLE);
	}
 elsif(((defined(&_XOPEN_VERSION) ? &_XOPEN_VERSION : 0) - 0>= 4)) {
	    eval 'sub __XPG_VISIBLE () {400;}' unless defined(&__XPG_VISIBLE);
	} else {
	    eval 'sub __XPG_VISIBLE () {300;}' unless defined(&__XPG_VISIBLE);
	}
    }
    if(defined(&_POSIX_C_SOURCE)) {
	if(((defined(&_POSIX_C_SOURCE) ? &_POSIX_C_SOURCE : 0) - 0>= 200112)) {
	    eval 'sub __POSIX_VISIBLE () {200112;}' unless defined(&__POSIX_VISIBLE);
	    eval 'sub __ISO_C_VISIBLE () {1999;}' unless defined(&__ISO_C_VISIBLE);
	}
 elsif(((defined(&_POSIX_C_SOURCE) ? &_POSIX_C_SOURCE : 0) - 0>= 199506)) {
	    eval 'sub __POSIX_VISIBLE () {199506;}' unless defined(&__POSIX_VISIBLE);
	    eval 'sub __ISO_C_VISIBLE () {1990;}' unless defined(&__ISO_C_VISIBLE);
	}
 elsif(((defined(&_POSIX_C_SOURCE) ? &_POSIX_C_SOURCE : 0) - 0>= 199309)) {
	    eval 'sub __POSIX_VISIBLE () {199309;}' unless defined(&__POSIX_VISIBLE);
	    eval 'sub __ISO_C_VISIBLE () {1990;}' unless defined(&__ISO_C_VISIBLE);
	}
 elsif(((defined(&_POSIX_C_SOURCE) ? &_POSIX_C_SOURCE : 0) - 0>= 2)) {
	    eval 'sub __POSIX_VISIBLE () {199209;}' unless defined(&__POSIX_VISIBLE);
	    eval 'sub __ISO_C_VISIBLE () {1990;}' unless defined(&__ISO_C_VISIBLE);
	} else {
	    eval 'sub __POSIX_VISIBLE () {199009;}' unless defined(&__POSIX_VISIBLE);
	    eval 'sub __ISO_C_VISIBLE () {1990;}' unless defined(&__ISO_C_VISIBLE);
	}
    }
 elsif(defined( &_POSIX_SOURCE)) {
	eval 'sub __POSIX_VISIBLE () {198808;}' unless defined(&__POSIX_VISIBLE);
	eval 'sub __ISO_C_VISIBLE () {0;}' unless defined(&__ISO_C_VISIBLE);
    }
    if(defined( &_ANSI_SOURCE)  && !defined( &__POSIX_VISIBLE)  && !defined( &__XPG_VISIBLE)) {
	eval 'sub __POSIX_VISIBLE () {0;}' unless defined(&__POSIX_VISIBLE);
	eval 'sub __XPG_VISIBLE () {0;}' unless defined(&__XPG_VISIBLE);
	eval 'sub __ISO_C_VISIBLE () {1990;}' unless defined(&__ISO_C_VISIBLE);
    }
    if(defined( &_ISOC99_SOURCE) || (defined( &__STDC_VERSION__)  && (defined(&__STDC_VERSION__) ? &__STDC_VERSION__ : 0) >= 199901)) {
	undef(&__ISO_C_VISIBLE) if defined(&__ISO_C_VISIBLE);
	eval 'sub __ISO_C_VISIBLE () {1999;}' unless defined(&__ISO_C_VISIBLE);
    }
    if(!defined( &_BSD_SOURCE)  && (defined( &_ANSI_SOURCE) || defined( &__XPG_VISIBLE) || defined( &__POSIX_VISIBLE))) {
	eval 'sub __BSD_VISIBLE () {0;}' unless defined(&__BSD_VISIBLE);
    }
    unless(defined(&__XPG_VISIBLE)) {
	eval 'sub __XPG_VISIBLE () {600;}' unless defined(&__XPG_VISIBLE);
    }
    unless(defined(&__POSIX_VISIBLE)) {
	eval 'sub __POSIX_VISIBLE () {200112;}' unless defined(&__POSIX_VISIBLE);
    }
    unless(defined(&__ISO_C_VISIBLE)) {
	eval 'sub __ISO_C_VISIBLE () {1999;}' unless defined(&__ISO_C_VISIBLE);
    }
    unless(defined(&__BSD_VISIBLE)) {
	eval 'sub __BSD_VISIBLE () {1;}' unless defined(&__BSD_VISIBLE);
    }
}
1;
