require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_GLIBCXX_ATOMIC_BASE_H)) {
    eval 'sub _GLIBCXX_ATOMIC_BASE_H () {1;}' unless defined(&_GLIBCXX_ATOMIC_BASE_H);
    require 'bits/c++config.ph';
    require 'stdint.ph';
    require 'bits/atomic_lockfree_defines.ph';
    require 'bits/move.ph';
    unless(defined(&_GLIBCXX_ALWAYS_INLINE)) {
	eval 'sub _GLIBCXX_ALWAYS_INLINE () { &inline  &__attribute__(( &__always_inline__));}' unless defined(&_GLIBCXX_ALWAYS_INLINE);
    }
    if((defined(&__cplusplus) ? &__cplusplus : undef) > 201703) {
    } else {
	eval("sub memory_order_relaxed () { 0; }") unless defined(&memory_order_relaxed);
	eval("sub memory_order_consume () { 1; }") unless defined(&memory_order_consume);
	eval("sub memory_order_acquire () { 2; }") unless defined(&memory_order_acquire);
	eval("sub memory_order_release () { 3; }") unless defined(&memory_order_release);
	eval("sub memory_order_acq_rel () { 4; }") unless defined(&memory_order_acq_rel);
	eval("sub memory_order_seq_cst () { 5; }") unless defined(&memory_order_seq_cst);
    }
    eval("sub __memory_order_mask () { 0x0ffff; }") unless defined(&__memory_order_mask);
    eval("sub __memory_order_modifier_mask () { 0xffff0000; }") unless defined(&__memory_order_modifier_mask);
    eval("sub __memory_order_hle_acquire () { 0x10000; }") unless defined(&__memory_order_hle_acquire);
    eval("sub __memory_order_hle_release () { 0x20000; }") unless defined(&__memory_order_hle_release);
    if((defined(&__cplusplus) ? &__cplusplus : undef) <= 201703) {
	eval 'sub _GLIBCXX20_INIT {
	    my($I) = @_;
    	    eval q();
	}' unless defined(&_GLIBCXX20_INIT);
    } else {
	eval 'sub __cpp_lib_atomic_value_initialization () {201911;}' unless defined(&__cpp_lib_atomic_value_initialization);
	eval 'sub _GLIBCXX20_INIT {
	    my($I) = @_;
    	    eval q(= $I);
	}' unless defined(&_GLIBCXX20_INIT);
    }
    eval 'sub ATOMIC_VAR_INIT {
        my($_VI) = @_;
	    eval q({ $_VI });
    }' unless defined(&ATOMIC_VAR_INIT);
    if((defined(&__GCC_ATOMIC_TEST_AND_SET_TRUEVAL) ? &__GCC_ATOMIC_TEST_AND_SET_TRUEVAL : undef) == 1) {
    } else {
    }
    eval 'sub ATOMIC_FLAG_INIT () {{ 0};}' unless defined(&ATOMIC_FLAG_INIT);
    if((defined(&__cplusplus) ? &__cplusplus : undef) > 201703) {
	undef(&_GLIBCXX20_INIT) if defined(&_GLIBCXX20_INIT);
    }
}
1;
