You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit added explicit specializations for is_integral<__int64> and is_integral<unsigned __int64 when compiling with Visual C++: 3c88e1b
It seems that by default HAVE_LONG_LONG is not defined on this platform, so these specializations do not collide with the specializations for is_integral<long long> and is_integral<unsigned long long>immediately above them.
However, other projects use HAVE_LONG_LONG on Windows, which leads to an error about the specialization already being defined. In particular, when I include <Python.h> from Anaconda for Windows before a header that includes some protobuf headers, I get the following compilation error:
[...]google/protobuf/stubs/type_traits.h(151): error C2766: explicit specialization; 'google::protobuf::internal::is_integral<__int64>' has already been defined
[...]google/protobuf/stubs/type_traits.h(143): note: see previous definition of 'is_integral<__int64>'
[...]google/protobuf/stubs/type_traits.h(152): error C2766: explicit specialization; 'google::protobuf::internal::is_integral<unsigned __int64>' has already been defined
[...]google/protobuf/stubs/type_traits.h(144): note: see previous definition of 'is_integral<unsigned __int64>'
Here's a simple repro, test.cc:
//#include <Python.h> // The following #define has the same effect.
#defineHAVE_LONG_LONG
#include"google/protobuf/stubs/type_traits.h"intmain(int argc, char** argv) {
return0;
}
Reproduced using the following command line with Visual Studio 2015 Update 1:
C:\temp> cl.exe test.cc /I<path\to\protobuf\src\>
Could the conditional compilation be refactored to avoid this problem? @xfxyjwf, since you made the commit, any ideas?
The text was updated successfully, but these errors were encountered:
This commit added explicit specializations for
is_integral<__int64>
andis_integral<unsigned __int64
when compiling with Visual C++: 3c88e1bIt seems that by default
HAVE_LONG_LONG
is not defined on this platform, so these specializations do not collide with the specializations foris_integral<long long>
andis_integral<unsigned long long>
immediately above them.However, other projects use
HAVE_LONG_LONG
on Windows, which leads to an error about the specialization already being defined. In particular, when I include<Python.h>
from Anaconda for Windows before a header that includes some protobuf headers, I get the following compilation error:Here's a simple repro,
test.cc
:Reproduced using the following command line with Visual Studio 2015 Update 1:
Could the conditional compilation be refactored to avoid this problem? @xfxyjwf, since you made the commit, any ideas?
The text was updated successfully, but these errors were encountered: