[ 
https://issues.apache.org/jira/browse/THRIFT-5462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17412772#comment-17412772
 ] 

Mario Emmenlauer commented on THRIFT-5462:
------------------------------------------

It would be pretty straightforward to support this. The slightly annoying part 
on the development side is that thrift currently features two build systems, 
and its not so nice to auto-generate headers with both. CMake would make this a 
trivial task, and also autotools can do it, but maintaining both is quite a 
nuisance. Therefore my best suggestion would be to implement this with manual 
"human" support. Now on the other hand this will put a higher burden on the 
release maintainers, currently mostly [~jensg] and I'm not particularly happy 
to add to his work list.

Cutting a long story short, its either an easy feature when thrift stops 
supporting autotools, or its an unlucky task for a human maintainer :(

> [C++] Expose preprocessor macros to inspect the Thrift library version
> ----------------------------------------------------------------------
>
>                 Key: THRIFT-5462
>                 URL: https://issues.apache.org/jira/browse/THRIFT-5462
>             Project: Thrift
>          Issue Type: Wish
>          Components: C++ - Library
>    Affects Versions: 0.14.2
>            Reporter: Antoine Pitrou
>            Priority: Major
>
> 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:
> {code:c++}
>   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
> {code}
> 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...



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to