require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&HEADER_SHA_H)) {
    eval 'sub HEADER_SHA_H () {1;}' unless defined(&HEADER_SHA_H);
    require 'openssl/e_os2.ph';
    require 'stddef.ph';
    if(defined(&__cplusplus)) {
    }
    if(defined( &OPENSSL_NO_SHA) || (defined( &OPENSSL_NO_SHA0)  && defined( &OPENSSL_NO_SHA1))) {
	die("SHA\ is\ disabled\.");
    }
    if(defined( &OPENSSL_FIPS)) {
	eval 'sub FIPS_SHA_SIZE_T () {\'size_t\';}' unless defined(&FIPS_SHA_SIZE_T);
    }
    if(defined( &OPENSSL_SYS_WIN16) || defined( &__LP32__)) {
	eval 'sub SHA_LONG () {\'unsigned long\';}' unless defined(&SHA_LONG);
    }
 elsif(defined( &OPENSSL_SYS_CRAY) || defined( &__ILP64__)) {
	eval 'sub SHA_LONG () {\'unsigned long\';}' unless defined(&SHA_LONG);
	eval 'sub SHA_LONG_LOG2 () {3;}' unless defined(&SHA_LONG_LOG2);
    } else {
	eval 'sub SHA_LONG () {\'unsigned int\';}' unless defined(&SHA_LONG);
    }
    eval 'sub SHA_LBLOCK () {16;}' unless defined(&SHA_LBLOCK);
    eval 'sub SHA_CBLOCK () {( &SHA_LBLOCK*4);}' unless defined(&SHA_CBLOCK);
    eval 'sub SHA_LAST_BLOCK () {( &SHA_CBLOCK-8);}' unless defined(&SHA_LAST_BLOCK);
    eval 'sub SHA_DIGEST_LENGTH () {20;}' unless defined(&SHA_DIGEST_LENGTH);
    unless(defined(&OPENSSL_NO_SHA0)) {
	if(defined(&OPENSSL_FIPS)) {
	}
    }
    unless(defined(&OPENSSL_NO_SHA1)) {
    }
    eval 'sub SHA256_CBLOCK () {( &SHA_LBLOCK*4);}' unless defined(&SHA256_CBLOCK);
    eval 'sub SHA224_DIGEST_LENGTH () {28;}' unless defined(&SHA224_DIGEST_LENGTH);
    eval 'sub SHA256_DIGEST_LENGTH () {32;}' unless defined(&SHA256_DIGEST_LENGTH);
    unless(defined(&OPENSSL_NO_SHA256)) {
    }
    eval 'sub SHA384_DIGEST_LENGTH () {48;}' unless defined(&SHA384_DIGEST_LENGTH);
    eval 'sub SHA512_DIGEST_LENGTH () {64;}' unless defined(&SHA512_DIGEST_LENGTH);
    unless(defined(&OPENSSL_NO_SHA512)) {
	eval 'sub SHA512_CBLOCK () {( &SHA_LBLOCK*8);}' unless defined(&SHA512_CBLOCK);
	if((defined( &_WIN32) || defined( &_WIN64))  && !defined( &__MINGW32__)) {
	    eval 'sub SHA_LONG64 () {\'unsigned __int64\';}' unless defined(&SHA_LONG64);
	    eval 'sub U64 {
	        my($C) = @_;
    		eval q($C &UI64);
	    }' unless defined(&U64);
	}
 elsif(defined( &__arch64__)) {
	    eval 'sub SHA_LONG64 () {\'unsigned long\';}' unless defined(&SHA_LONG64);
	    eval 'sub U64 {
	        my($C) = @_;
    		eval q($C &UL);
	    }' unless defined(&U64);
	} else {
	    eval 'sub SHA_LONG64 () {\'unsigned long long\';}' unless defined(&SHA_LONG64);
	    eval 'sub U64 {
	        my($C) = @_;
    		eval q($C &ULL);
	    }' unless defined(&U64);
	}
    }
    unless(defined(&OPENSSL_NO_SHA512)) {
    }
    if(defined(&__cplusplus)) {
    }
}
1;
