require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_GLIBCXX_DECIMAL_IMPL)) {
    eval 'sub _GLIBCXX_DECIMAL_IMPL () {1;}' unless defined(&_GLIBCXX_DECIMAL_IMPL);
    eval 'sub _DEFINE_DECIMAL_COMPOUND_ASSIGNMENT_DEC {
        my($_Op1, $_Op2, $_T1, $_T2) = @_;
	    eval q( &inline $_T1& $_T1:: &operator $_Op1($_T2  &__rhs) {  &__setval( &__getval() $_Op2  ($__rhs->{__getval})());  &return * &this; });
    }' unless defined(&_DEFINE_DECIMAL_COMPOUND_ASSIGNMENT_DEC);
    eval 'sub _DEFINE_DECIMAL_COMPOUND_ASSIGNMENT_INT {
        my($_Op1, $_Op2, $_T1, $_T2) = @_;
	    eval q( &inline $_T1& $_T1:: &operator $_Op1($_T2  &__rhs) {  &__setval( &__getval() $_Op2  &__rhs);  &return * &this; });
    }' unless defined(&_DEFINE_DECIMAL_COMPOUND_ASSIGNMENT_INT);
    eval 'sub _DEFINE_DECIMAL_COMPOUND_ASSIGNMENTS {
        my($_Op1, $_Op2, $_T1) = @_;
	    eval q( &_DEFINE_DECIMAL_COMPOUND_ASSIGNMENT_DEC($_Op1, $_Op2, $_T1,  &decimal32)  &_DEFINE_DECIMAL_COMPOUND_ASSIGNMENT_DEC($_Op1, $_Op2, $_T1,  &decimal64)  &_DEFINE_DECIMAL_COMPOUND_ASSIGNMENT_DEC($_Op1, $_Op2, $_T1,  &decimal128)  &_DEFINE_DECIMAL_COMPOUND_ASSIGNMENT_INT($_Op1, $_Op2, $_T1, \'int\')  &_DEFINE_DECIMAL_COMPOUND_ASSIGNMENT_INT($_Op1, $_Op2, $_T1, \'unsigned int\')  &_DEFINE_DECIMAL_COMPOUND_ASSIGNMENT_INT($_Op1, $_Op2, $_T1, \'long\')  &_DEFINE_DECIMAL_COMPOUND_ASSIGNMENT_INT($_Op1, $_Op2, $_T1, \'unsigned long\')  &_DEFINE_DECIMAL_COMPOUND_ASSIGNMENT_INT($_Op1, $_Op2, $_T1, \'long long\')  &_DEFINE_DECIMAL_COMPOUND_ASSIGNMENT_INT($_Op1, $_Op2, $_T1, \'unsigned long long\'));
    }' unless defined(&_DEFINE_DECIMAL_COMPOUND_ASSIGNMENTS);
    undef(&_DEFINE_DECIMAL_COMPOUND_ASSIGNMENT_DEC) if defined(&_DEFINE_DECIMAL_COMPOUND_ASSIGNMENT_DEC);
    undef(&_DEFINE_DECIMAL_COMPOUND_ASSIGNMENT_INT) if defined(&_DEFINE_DECIMAL_COMPOUND_ASSIGNMENT_INT);
    undef(&_DEFINE_DECIMAL_COMPOUND_ASSIGNMENTS) if defined(&_DEFINE_DECIMAL_COMPOUND_ASSIGNMENTS);
    eval 'sub _DEFINE_DECIMAL_UNARY_OP {
        my($_Op, $_Tp) = @_;
	    eval q( &inline $_Tp  &operator $_Op($_Tp  &__rhs) { $_Tp  &__tmp;  ($__tmp->{__setval})($_Op  ($__rhs->{__getval})());  &return  &__tmp; });
    }' unless defined(&_DEFINE_DECIMAL_UNARY_OP);
    undef(&_DEFINE_DECIMAL_UNARY_OP) if defined(&_DEFINE_DECIMAL_UNARY_OP);
    eval 'sub _DEFINE_DECIMAL_BINARY_OP_WITH_DEC {
        my($_Op, $_T1, $_T2, $_T3) = @_;
	    eval q( &inline $_T1  &operator $_Op($_T2  &__lhs, $_T3  &__rhs) { $_T1  &__retval;  ($__retval->{__setval})( ($__lhs->{__getval})() $_Op  ($__rhs->{__getval})());  &return  &__retval; });
    }' unless defined(&_DEFINE_DECIMAL_BINARY_OP_WITH_DEC);
    eval 'sub _DEFINE_DECIMAL_BINARY_OP_BOTH {
        my($_Op, $_T1, $_T2, $_T3) = @_;
	    eval q( &inline $_T1  &operator $_Op($_T2  &__lhs, $_T3  &__rhs) { $_T1  &__retval;  ($__retval->{__setval})( ($__lhs->{__getval})() $_Op  ($__rhs->{__getval})());  &return  &__retval; });
    }' unless defined(&_DEFINE_DECIMAL_BINARY_OP_BOTH);
    eval 'sub _DEFINE_DECIMAL_BINARY_OP_LHS {
        my($_Op, $_T1, $_T2) = @_;
	    eval q( &inline $_T1  &operator $_Op($_T1  &__lhs, $_T2  &__rhs) { $_T1  &__retval;  ($__retval->{__setval})( ($__lhs->{__getval})() $_Op  &__rhs);  &return  &__retval; });
    }' unless defined(&_DEFINE_DECIMAL_BINARY_OP_LHS);
    eval 'sub _DEFINE_DECIMAL_BINARY_OP_RHS {
        my($_Op, $_T1, $_T2) = @_;
	    eval q( &inline $_T1  &operator $_Op($_T2  &__lhs, $_T1  &__rhs) { $_T1  &__retval;  ($__retval->{__setval})( &__lhs $_Op  ($__rhs->{__getval})());  &return  &__retval; });
    }' unless defined(&_DEFINE_DECIMAL_BINARY_OP_RHS);
    eval 'sub _DEFINE_DECIMAL_BINARY_OP_WITH_INT {
        my($_Op, $_T1) = @_;
	    eval q( &_DEFINE_DECIMAL_BINARY_OP_LHS($_Op, $_T1, \'int\');  &_DEFINE_DECIMAL_BINARY_OP_LHS($_Op, $_T1, \'unsigned int\');  &_DEFINE_DECIMAL_BINARY_OP_LHS($_Op, $_T1, \'long\');  &_DEFINE_DECIMAL_BINARY_OP_LHS($_Op, $_T1, \'unsigned long\');  &_DEFINE_DECIMAL_BINARY_OP_LHS($_Op, $_T1, \'long long\');  &_DEFINE_DECIMAL_BINARY_OP_LHS($_Op, $_T1, \'unsigned long long\');  &_DEFINE_DECIMAL_BINARY_OP_RHS($_Op, $_T1, \'int\');  &_DEFINE_DECIMAL_BINARY_OP_RHS($_Op, $_T1, \'unsigned int\');  &_DEFINE_DECIMAL_BINARY_OP_RHS($_Op, $_T1, \'long\');  &_DEFINE_DECIMAL_BINARY_OP_RHS($_Op, $_T1, \'unsigned long\');  &_DEFINE_DECIMAL_BINARY_OP_RHS($_Op, $_T1, \'long long\');  &_DEFINE_DECIMAL_BINARY_OP_RHS($_Op, $_T1, \'unsigned long long\'););
    }' unless defined(&_DEFINE_DECIMAL_BINARY_OP_WITH_INT);
    undef(&_DEFINE_DECIMAL_BINARY_OP_WITH_DEC) if defined(&_DEFINE_DECIMAL_BINARY_OP_WITH_DEC);
    undef(&_DEFINE_DECIMAL_BINARY_OP_BOTH) if defined(&_DEFINE_DECIMAL_BINARY_OP_BOTH);
    undef(&_DEFINE_DECIMAL_BINARY_OP_LHS) if defined(&_DEFINE_DECIMAL_BINARY_OP_LHS);
    undef(&_DEFINE_DECIMAL_BINARY_OP_RHS) if defined(&_DEFINE_DECIMAL_BINARY_OP_RHS);
    undef(&_DEFINE_DECIMAL_BINARY_OP_WITH_INT) if defined(&_DEFINE_DECIMAL_BINARY_OP_WITH_INT);
    eval 'sub _DEFINE_DECIMAL_COMPARISON_BOTH {
        my($_Op, $_T1, $_T2) = @_;
	    eval q( &inline  &bool  &operator $_Op($_T1  &__lhs, $_T2  &__rhs) {  &return  ($__lhs->{__getval})() $_Op  ($__rhs->{__getval})(); });
    }' unless defined(&_DEFINE_DECIMAL_COMPARISON_BOTH);
    eval 'sub _DEFINE_DECIMAL_COMPARISON_LHS {
        my($_Op, $_T1, $_T2) = @_;
	    eval q( &inline  &bool  &operator $_Op($_T1  &__lhs, $_T2  &__rhs) {  &return  ($__lhs->{__getval})() $_Op  &__rhs; });
    }' unless defined(&_DEFINE_DECIMAL_COMPARISON_LHS);
    eval 'sub _DEFINE_DECIMAL_COMPARISON_RHS {
        my($_Op, $_T1, $_T2) = @_;
	    eval q( &inline  &bool  &operator $_Op($_T1  &__lhs, $_T2  &__rhs) {  &return  &__lhs $_Op  ($__rhs->{__getval})(); });
    }' unless defined(&_DEFINE_DECIMAL_COMPARISON_RHS);
    eval 'sub _DEFINE_DECIMAL_COMPARISONS {
        my($_Op, $_Tp) = @_;
	    eval q( &_DEFINE_DECIMAL_COMPARISON_BOTH($_Op, $_Tp,  &decimal32)  &_DEFINE_DECIMAL_COMPARISON_BOTH($_Op, $_Tp,  &decimal64)  &_DEFINE_DECIMAL_COMPARISON_BOTH($_Op, $_Tp,  &decimal128)  &_DEFINE_DECIMAL_COMPARISON_LHS($_Op, $_Tp, \'int\')  &_DEFINE_DECIMAL_COMPARISON_LHS($_Op, $_Tp, \'unsigned int\')  &_DEFINE_DECIMAL_COMPARISON_LHS($_Op, $_Tp, \'long\')  &_DEFINE_DECIMAL_COMPARISON_LHS($_Op, $_Tp, \'unsigned long\')  &_DEFINE_DECIMAL_COMPARISON_LHS($_Op, $_Tp, \'long long\')  &_DEFINE_DECIMAL_COMPARISON_LHS($_Op, $_Tp, \'unsigned long long\')  &_DEFINE_DECIMAL_COMPARISON_RHS($_Op, \'int\', $_Tp)  &_DEFINE_DECIMAL_COMPARISON_RHS($_Op, \'unsigned int\', $_Tp)  &_DEFINE_DECIMAL_COMPARISON_RHS($_Op, \'long\', $_Tp)  &_DEFINE_DECIMAL_COMPARISON_RHS($_Op, \'unsigned long\', $_Tp)  &_DEFINE_DECIMAL_COMPARISON_RHS($_Op, \'long long\', $_Tp)  &_DEFINE_DECIMAL_COMPARISON_RHS($_Op, \'unsigned long long\', $_Tp));
    }' unless defined(&_DEFINE_DECIMAL_COMPARISONS);
    undef(&_DEFINE_DECIMAL_COMPARISON_BOTH) if defined(&_DEFINE_DECIMAL_COMPARISON_BOTH);
    undef(&_DEFINE_DECIMAL_COMPARISON_LHS) if defined(&_DEFINE_DECIMAL_COMPARISON_LHS);
    undef(&_DEFINE_DECIMAL_COMPARISON_RHS) if defined(&_DEFINE_DECIMAL_COMPARISON_RHS);
    undef(&_DEFINE_DECIMAL_COMPARISONS) if defined(&_DEFINE_DECIMAL_COMPARISONS);
}
1;
