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

Xavier Lepaul commented on THRIFT-1031:
---------------------------------------

Hi,
I have a small issue with the patch (I'm using the v0.1): the generated code 
for enums does not compile. I have a simple enum
{code}enum AccountType {CHECKING, SAVINGS}{code}
In the generated AccountType_types.cpp, the following line fails to compile:
{code}const std::map<int, const char*> 
_AccountType_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(2, 
_kAccountTypeValues, _kAccountTypeNames), ::apache::thrift::TEnumIterator(-1, 
NULL, NULL));{code}

with the following error:
{noformat}
1>c:\program files\microsoft visual studio 9.0\vc\include\xutility(764) : error 
C2039: 'iterator_category' : is not a member of 'apache::thrift::TEnumIterator'
1>        e:\tools\thrift\thrift-0.6.0-patched\lib\cpp\src\thrift.h(50) : see 
declaration of 'apache::thrift::TEnumIterator'
1>        c:\program files\microsoft visual studio 
9.0\vc\include\xutility(1598) : see reference to class template instantiation 
'std::iterator_traits<_Iter>' being compiled
1>        with
1>        [
1>            _Iter=apache::thrift::TEnumIterator
1>        ]
1>        c:\program files\microsoft visual studio 9.0\vc\include\map(120) : 
see reference to function template instantiation 'void 
std::_Debug_range<_Iter>(_InIt,_InIt,const wchar_t *,unsigned int)' being 
compiled
1>        with
1>        [
1>            _Iter=apache::thrift::TEnumIterator,
1>            _InIt=apache::thrift::TEnumIterator
1>        ]
1>        e:\temp\serial_cpp\gen-cpp\accounttype_types.cpp(18) : see reference 
to function template instantiation 
'std::map<_Kty,_Ty>::map<apache::thrift::TEnumIterator>(_Iter,_Iter)' being 
compiled
1>        with
1>        [
1>            _Kty=int,
1>            _Ty=const char *,
1>            _Iter=apache::thrift::TEnumIterator
1>        ]
{noformat}

Any idea? Everything else is working fine, though. Thanks for the patch!

> Patch to compile Thrift for vc++ 9.0 and 10.0
> ---------------------------------------------
>
>                 Key: THRIFT-1031
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1031
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>         Environment: Windows XP 32bit, vc++ 9.0, 10.0
>            Reporter: James Dickson
>            Priority: Trivial
>             Fix For: 0.7
>
>         Attachments: thrift_msvc.patch, thrift_msvc_v0_1.patch
>
>
> At our company we need clients running on Windows being able to connect to 
> our linux servers running hypertable. The attached patch enables the parts 
> needed by Hypertable to be compiled on Windows using either the VC++ 9.0 or 
> 10.0 compilers.
> Having read previous posts about ports using boost::asio we found these to be 
> too intrusive for our needs. This version uses pthreads_win32 and winsock2 
> and is as designed to be as un-intrusive as is possible to the original unix 
> code base. It is mostly #defines between unix sockets and winsock2 sockets. 
> We also tried to follow the folder structuring of the C# runtime that has 
> visual studio solutions to be consistent.
> More details are in the README as not all the functionality of the original 
> unix code base is available to windows users. We will add the missing 
> functionality, we just wanted to share what we had as for a Windows based 
> client for us it is sufficient.
> The patch is based on the latest revision in SVN, we would love feedback and 
> any code reviews. If there is any possibility of this being added to the main 
> trunk then that would be much appreciated, however we don't expect that.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to