Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-5462

Expose preprocessor macros to inspect the Thrift library version

    XMLWordPrintableJSON

Details

    • Wish
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 0.14.2
    • None
    • C++ - Library
    • None

    Description

      In Parquet C++, we would like to make use of the new TConfiguration introduced in 0.14.0. However, we also want our source code to be compatible with previous versions. It would be made greatly easier if we could do that using preprocessor directives, such as:

        uint8_t* buf = ...;
        unt32_t len = ...;
        std::shared_ptr<ThriftBuffer> mem_transport;
      #if THRIFT_VERSION_MAJOR > 0 || THRIFT_VERSION_MINOR >= 14
        auto config = std::make_shared<TConfiguration>();
        config->setMaxMessageSize(...);
        mem_transport = std::make_shared<TMemoryBuffer>(
          buf, len, TMemoryBuffer::OBSERVE, config);
      #else
        mem_transport = std::make_shared<TMemoryBuffer>(buf, len);
      #endif
      

      However, given that the C++ library doesn't seem to expose such constants, we're going to need to run custom tests during the configuration step to find out whether TConfiguration is available...

      Attachments

        Activity

          People

            Unassigned Unassigned
            apitrou Antoine Pitrou
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: