You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "James E. King III (JIRA)" <ji...@apache.org> on 2018/12/18 15:23:00 UTC

[jira] [Updated] (THRIFT-4680) TBufferTransports.h does not compile under Visual Studio 2017

     [ https://issues.apache.org/jira/browse/THRIFT-4680?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

James E. King III updated THRIFT-4680:
--------------------------------------
    Summary: TBufferTransports.h does not compile under Visual Studio 2017  (was: TBufferTransports.h does not compile under Windows 10)

> TBufferTransports.h does not compile under Visual Studio 2017
> -------------------------------------------------------------
>
>                 Key: THRIFT-4680
>                 URL: https://issues.apache.org/jira/browse/THRIFT-4680
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>    Affects Versions: 0.11.0
>         Environment: Visual Studio 2017
>            Reporter: Sebastian Stüker
>            Assignee: James E. King III
>            Priority: Critical
>             Fix For: 0.12.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> When compiling under Windows 10 and including TBufferTransports.h, compilation fails with
> Error    C2589    '(': illegal token on right side of '::' (compiling source file [...])  [...]\thrift-0.11.0\lib\cpp\src\thrift\transport\tbuffertransports.h    452
> The error seems to be caused by the fact that in windows.h a macro max is defined.
> Possible work arounds are to define NOMINMAX in order to prevent windows.h to define the macro max.
> Alternatively, before the statement on line 452 undefine the macro
> {{#undef max}}
>  {{maxBufferSize_ = std::numeric_limits<uint32_t>::max()}}
> However, I would prefer a version, where it is checked whether max is defined as a macro, and if so, to use the other, correct syntax for this case of:
> {{maxBufferSize_ = (std::numeric_limits<uint32_t>::max)();}}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)