require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_STDDEF_H_)) {
    eval 'sub _STDDEF_H_ () {1;}' unless defined(&_STDDEF_H_);
    require 'sys/cdefs.ph';
    require 'sys/featuretest.ph';
    require 'machine/ansi.ph';
    if(defined(&_BSD_PTRDIFF_T_)) {
	undef(&_BSD_PTRDIFF_T_) if defined(&_BSD_PTRDIFF_T_);
    }
    if(defined(&_BSD_SIZE_T_)) {
	undef(&_BSD_SIZE_T_) if defined(&_BSD_SIZE_T_);
    }
    if(defined(&_BSD_WCHAR_T_)  && !defined(&__cplusplus)) {
	undef(&_BSD_WCHAR_T_) if defined(&_BSD_WCHAR_T_);
    }
    require 'sys/null.ph';
    if( &__GNUC_PREREQ__(4, 0)) {
	eval 'sub offsetof {
	    my($type, $member) = @_;
    	    eval q( &__builtin_offsetof($type, $member));
	}' unless defined(&offsetof);
    }
 elsif(!defined(&__cplusplus)) {
	eval 'sub offsetof {
	    my($type, $member) = @_;
    	    eval q((((($type *)0)->$member)));
	}' unless defined(&offsetof);
    } else {
	if(! &__GNUC_PREREQ__(3, 4)) {
	    eval 'sub __offsetof__ {
	        my($a) = @_;
    		eval q($a);
	    }' unless defined(&__offsetof__);
	}
	eval 'sub offsetof {
	    my($type, $member) = @_;
    	    eval q( &__offsetof__(( &reinterpret_cast<\'size_t\'> ( &reinterpret_cast< &const  &volatile \'char\' &>( &static_cast<$type *>(0)->$member)))));
	}' unless defined(&offsetof);
    }
    if(((defined(&__STDC_VERSION__) ? &__STDC_VERSION__ : undef) - 0) >= 201112 || ((defined(&__cplusplus) ? &__cplusplus : undef) - 0) >= 201103) {
    }
}
1;
