Ticket #54017: patch-lang_qt_src_qgpgmeencryptjob.diff

File patch-lang_qt_src_qgpgmeencryptjob.diff, 2.2 KB (added by RJVB (René Bertin), 7 years ago)
  • lang/qt/src/qgpgmeencryptjob.cpp

    Rename encrypt() so that the code builds with FreeBSD 10.4's libc++, which
    has a bug that causes std::bind() to fail with the original function name:
    
    qgpgmeencryptjob.cpp:134:9: error: no matching function for call to 'bind'
        run(std::bind(&encrypt,
            ^~~~~~~~~
    /usr/include/c++/v1/functional:2185:1: note: candidate template ignored:
    couldn't infer template argument '_Fp'
    bind(_Fp&& __f, _BoundArgs&&... __bound_args)
    ^
    /usr/include/c++/v1/functional:2194:1: note: candidate template ignored:
    couldn't infer template argument '_Rp'
    bind(_Fp&& __f, _BoundArgs&&... __bound_args)
    ^
    1 error generated.
    
    old new void QGpgMEEncryptJob::setOutputIsBase64Encoded(bool o 
    6666    mOutputIsBase64Encoded = on;
    6767}
    6868
    69 static QGpgMEEncryptJob::result_type encrypt(Context *ctx, QThread *thread,
     69static QGpgMEEncryptJob::result_type do_encrypt(Context *ctx, QThread *thread,
    7070        const std::vector<Key> &recipients,
    7171        const std::weak_ptr<QIODevice> &plainText_,
    7272        const std::weak_ptr<QIODevice> &cipherText_,
    static QGpgMEEncryptJob::result_type encrypt_qba(Conte 
    118118    if (!buffer->open(QIODevice::ReadOnly)) {
    119119        assert(!"This should never happen: QBuffer::open() failed");
    120120    }
    121     return encrypt(ctx, 0, recipients, buffer, std::shared_ptr<QIODevice>(), eflags, outputIsBsse64Encoded);
     121    return do_encrypt(ctx, 0, recipients, buffer, std::shared_ptr<QIODevice>(), eflags, outputIsBsse64Encoded);
    122122}
    123123
    124124Error QGpgMEEncryptJob::start(const std::vector<Key> &recipients, const QByteArray &plainText, bool alwaysTrust)
    Error QGpgMEEncryptJob::start(const std::vector<Key> & 
    131131void QGpgMEEncryptJob::start(const std::vector<Key> &recipients, const std::shared_ptr<QIODevice> &plainText,
    132132                             const std::shared_ptr<QIODevice> &cipherText, const Context::EncryptionFlags eflags)
    133133{
    134     run(std::bind(&encrypt,
     134    run(std::bind(&do_encrypt,
    135135                    std::placeholders::_1, std::placeholders::_2,
    136136                    recipients,
    137137                    std::placeholders::_3, std::placeholders::_4,