require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&OPENSSL_E_OS2_H)) {
    eval 'sub OPENSSL_E_OS2_H () {1;}' unless defined(&OPENSSL_E_OS2_H);
    require 'openssl/macros.ph';
    unless(defined(&OPENSSL_NO_DEPRECATED_3_0)) {
	eval 'sub HEADER_E_OS2_H () {1;}' unless defined(&HEADER_E_OS2_H);
    }
    require 'openssl/opensslconf.ph';
    if(defined(&__cplusplus)) {
    }
    eval 'sub OPENSSL_SYS_UNIX () {1;}' unless defined(&OPENSSL_SYS_UNIX);
    if(defined(&OPENSSL_SYS_MSDOS)) {
	undef(&OPENSSL_SYS_UNIX) if defined(&OPENSSL_SYS_UNIX);
    }
    if(defined(&OPENSSL_SYS_UEFI)) {
	undef(&OPENSSL_SYS_UNIX) if defined(&OPENSSL_SYS_UNIX);
    }
 elsif(defined(&OPENSSL_SYS_UWIN)) {
	undef(&OPENSSL_SYS_UNIX) if defined(&OPENSSL_SYS_UNIX);
	eval 'sub OPENSSL_SYS_WIN32_UWIN () {1;}' unless defined(&OPENSSL_SYS_WIN32_UWIN);
    } else {
	if(defined(&__CYGWIN__) || defined(&OPENSSL_SYS_CYGWIN)) {
	    eval 'sub OPENSSL_SYS_WIN32_CYGWIN () {1;}' unless defined(&OPENSSL_SYS_WIN32_CYGWIN);
	} else {
	    if(defined(&_WIN32) || defined(&OPENSSL_SYS_WIN32)) {
		undef(&OPENSSL_SYS_UNIX) if defined(&OPENSSL_SYS_UNIX);
		if(!defined(&OPENSSL_SYS_WIN32)) {
		    eval 'sub OPENSSL_SYS_WIN32 () {1;}' unless defined(&OPENSSL_SYS_WIN32);
		}
	    }
	    if(defined(&_WIN64) || defined(&OPENSSL_SYS_WIN64)) {
		undef(&OPENSSL_SYS_UNIX) if defined(&OPENSSL_SYS_UNIX);
		if(!defined(&OPENSSL_SYS_WIN64)) {
		    eval 'sub OPENSSL_SYS_WIN64 () {1;}' unless defined(&OPENSSL_SYS_WIN64);
		}
	    }
	    if(defined(&OPENSSL_SYS_WINNT)) {
		undef(&OPENSSL_SYS_UNIX) if defined(&OPENSSL_SYS_UNIX);
	    }
	    if(defined(&OPENSSL_SYS_WINCE)) {
		undef(&OPENSSL_SYS_UNIX) if defined(&OPENSSL_SYS_UNIX);
	    }
	}
    }
    if(defined(&OPENSSL_SYS_WIN32) || defined(&OPENSSL_SYS_WIN64) || defined(&OPENSSL_SYS_WINNT) || defined(&OPENSSL_SYS_WINCE)) {
	undef(&OPENSSL_SYS_UNIX) if defined(&OPENSSL_SYS_UNIX);
	eval 'sub OPENSSL_SYS_WINDOWS () {1;}' unless defined(&OPENSSL_SYS_WINDOWS);
	unless(defined(&OPENSSL_SYS_MSDOS)) {
	    eval 'sub OPENSSL_SYS_MSDOS () {1;}' unless defined(&OPENSSL_SYS_MSDOS);
	}
    }
    if(defined(&OPENSSL_SYS_WINDOWS)) {
	unless(defined(&OPENSSL_OPT_WINDLL)) {
	    if(defined(&_WINDLL) ) {
		eval 'sub OPENSSL_OPT_WINDLL () {1;}' unless defined(&OPENSSL_OPT_WINDLL);
	    }
	}
    }
    if(defined(&__VMS) || defined(&VMS)) {
	if(!defined(&OPENSSL_SYS_VMS)) {
	    undef(&OPENSSL_SYS_UNIX) if defined(&OPENSSL_SYS_UNIX);
	    eval 'sub OPENSSL_SYS_VMS () {1;}' unless defined(&OPENSSL_SYS_VMS);
	}
	if(defined(&__DECC)) {
	    eval 'sub OPENSSL_SYS_VMS_DECC () {1;}' unless defined(&OPENSSL_SYS_VMS_DECC);
	}
 elsif(defined(&__DECCXX)) {
	    eval 'sub OPENSSL_SYS_VMS_DECC () {1;}' unless defined(&OPENSSL_SYS_VMS_DECC);
	    eval 'sub OPENSSL_SYS_VMS_DECCXX () {1;}' unless defined(&OPENSSL_SYS_VMS_DECCXX);
	} else {
	    eval 'sub OPENSSL_SYS_VMS_NODECC () {1;}' unless defined(&OPENSSL_SYS_VMS_NODECC);
	}
    }
    if(defined(&OPENSSL_SYS_UNIX)) {
	if(defined(&linux) || defined(&__linux__)  && !defined(&OPENSSL_SYS_LINUX)) {
	    eval 'sub OPENSSL_SYS_LINUX () {1;}' unless defined(&OPENSSL_SYS_LINUX);
	}
	if(defined(&_AIX)  && !defined(&OPENSSL_SYS_AIX)) {
	    eval 'sub OPENSSL_SYS_AIX () {1;}' unless defined(&OPENSSL_SYS_AIX);
	}
    }
    if(defined(&__VOS__)  && !defined(&OPENSSL_SYS_VOS)) {
	eval 'sub OPENSSL_SYS_VOS () {1;}' unless defined(&OPENSSL_SYS_VOS);
	if(defined(&__HPPA__)) {
	    eval 'sub OPENSSL_SYS_VOS_HPPA () {1;}' unless defined(&OPENSSL_SYS_VOS_HPPA);
	}
	if(defined(&__IA32__)) {
	    eval 'sub OPENSSL_SYS_VOS_IA32 () {1;}' unless defined(&OPENSSL_SYS_VOS_IA32);
	}
    }
    if(defined(&__TANDEM)) {
	if(defined(&_STRING)) {
	    require 'strings.ph';
	}
	eval 'sub OPENSSL_USE_BUILD_DATE () {1;}' unless defined(&OPENSSL_USE_BUILD_DATE);
	if(defined(&OPENSSL_THREADS)  && defined(&_SPT_MODEL_)) {
	    eval 'sub SPT_THREAD_SIGNAL () {1;}' unless defined(&SPT_THREAD_SIGNAL);
	    eval 'sub SPT_THREAD_AWARE () {1;}' unless defined(&SPT_THREAD_AWARE);
	    require 'spthread.ph';
	}
 elsif(defined(&OPENSSL_THREADS)  && defined(&_PUT_MODEL_)) {
	    require 'pthread.ph';
	}
    }
    if(defined(&OPENSSL_SYS_WINDOWS)  && defined(&OPENSSL_OPT_WINDLL)) {
	eval 'sub OPENSSL_EXPORT () { &extern  &__declspec( &dllexport);}' unless defined(&OPENSSL_EXPORT);
	eval 'sub OPENSSL_EXTERN () { &extern  &__declspec( &dllimport);}' unless defined(&OPENSSL_EXTERN);
    } else {
	eval 'sub OPENSSL_EXPORT () { &extern;}' unless defined(&OPENSSL_EXPORT);
	eval 'sub OPENSSL_EXTERN () { &extern;}' unless defined(&OPENSSL_EXTERN);
    }
    if(defined(&_WIN32)) {
	if(defined(&_WIN64)) {
	    eval 'sub ossl_ssize_t () { &__int64;}' unless defined(&ossl_ssize_t);
	    eval 'sub OSSL_SSIZE_MAX () { &_I64_MAX;}' unless defined(&OSSL_SSIZE_MAX);
	} else {
	    eval 'sub ossl_ssize_t () {\'int\';}' unless defined(&ossl_ssize_t);
	    eval 'sub OSSL_SSIZE_MAX () { &INT_MAX;}' unless defined(&OSSL_SSIZE_MAX);
	}
    }
    if(defined(&OPENSSL_SYS_UEFI)  && !defined(&ossl_ssize_t)) {
	eval 'sub ossl_ssize_t () { &INTN;}' unless defined(&ossl_ssize_t);
	eval 'sub OSSL_SSIZE_MAX () { &MAX_INTN;}' unless defined(&OSSL_SSIZE_MAX);
    }
    unless(defined(&ossl_ssize_t)) {
	eval 'sub ossl_ssize_t () { &ssize_t;}' unless defined(&ossl_ssize_t);
	if(defined(&SSIZE_MAX)) {
	    eval 'sub OSSL_SSIZE_MAX () { &SSIZE_MAX;}' unless defined(&OSSL_SSIZE_MAX);
	}
 elsif(defined(&_POSIX_SSIZE_MAX)) {
	    eval 'sub OSSL_SSIZE_MAX () { &_POSIX_SSIZE_MAX;}' unless defined(&OSSL_SSIZE_MAX);
	} else {
	    eval 'sub OSSL_SSIZE_MAX () {(( &ssize_t)( &SIZE_MAX >> 1));}' unless defined(&OSSL_SSIZE_MAX);
	}
    }
    if(defined(&UNUSEDRESULT_DEBUG)) {
	eval 'sub __owur () { &__attribute__(( &__warn_unused_result__));}' unless defined(&__owur);
    } else {
	eval 'sub __owur () {1;}' unless defined(&__owur);
    }
    eval 'sub OPENSSL_NO_INTTYPES_H () {1;}' unless defined(&OPENSSL_NO_INTTYPES_H);
    eval 'sub OPENSSL_NO_STDINT_H () {1;}' unless defined(&OPENSSL_NO_STDINT_H);
    if(defined(&OPENSSL_SYS_UEFI)) {
    }
 elsif((defined(&__STDC_VERSION__)  && (defined(&__STDC_VERSION__) ? &__STDC_VERSION__ : undef) >= 199901) || defined(&__osf__) || defined(&__sgi) || defined(&__hpux) || defined(&OPENSSL_SYS_VMS) || defined(&__OpenBSD__)) {
	require 'inttypes.ph';
	undef(&OPENSSL_NO_INTTYPES_H) if defined(&OPENSSL_NO_INTTYPES_H);
	undef(&OPENSSL_NO_STDINT_H) if defined(&OPENSSL_NO_STDINT_H);
    }
 elsif(defined(&_MSC_VER)  && (defined(&_MSC_VER) ? &_MSC_VER : undef) < 1600) {
    } else {
	require 'stdint.ph';
	undef(&OPENSSL_NO_STDINT_H) if defined(&OPENSSL_NO_STDINT_H);
    }
    if(defined(&__STDC_VERSION__)  && (defined(&__STDC_VERSION__) ? &__STDC_VERSION__ : undef) >= 199901  && defined(&INTMAX_MAX)  && defined(&UINTMAX_MAX)) {
    } else {
    }
    if(!defined(&inline)  && !defined(&__cplusplus)) {
	if(defined(&__STDC_VERSION__)  && (defined(&__STDC_VERSION__) ? &__STDC_VERSION__ : undef) >= 199901) {
	    eval 'sub ossl_inline () { &inline;}' unless defined(&ossl_inline);
	}
 elsif(defined(&__GNUC__)  && (defined(&__GNUC__) ? &__GNUC__ : undef) >= 2) {
	    eval 'sub ossl_inline () { &__inline__;}' unless defined(&ossl_inline);
	}
 elsif(defined(&_MSC_VER)) {
	    eval 'sub ossl_inline () { &__inline;}' unless defined(&ossl_inline);
	} else {
	    eval 'sub ossl_inline () {1;}' unless defined(&ossl_inline);
	}
    } else {
	eval 'sub ossl_inline () { &inline;}' unless defined(&ossl_inline);
    }
    if(defined(&__STDC_VERSION__)  && (defined(&__STDC_VERSION__) ? &__STDC_VERSION__ : undef) >= 201112  && !defined(&__cplusplus)) {
	eval 'sub ossl_noreturn () { &_Noreturn;}' unless defined(&ossl_noreturn);
    }
 elsif(defined(&__GNUC__)  && (defined(&__GNUC__) ? &__GNUC__ : undef) >= 2) {
	eval 'sub ossl_noreturn () { &__attribute__(( &noreturn));}' unless defined(&ossl_noreturn);
    } else {
	eval 'sub ossl_noreturn () {1;}' unless defined(&ossl_noreturn);
    }
    if(defined(&__GNUC__)) {
	eval 'sub ossl_unused () { &__attribute__(( &unused));}' unless defined(&ossl_unused);
    } else {
	eval 'sub ossl_unused () {1;}' unless defined(&ossl_unused);
    }
    if(defined(&__cplusplus)) {
    }
}
1;
