mirror of
https://github.com/google/brotli.git
synced 2026-09-22 06:35:52 +00:00
vector.data() not supported on MS VC++ 9.0 #44
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @anthrotype on GitHub (Oct 2, 2015).
std::vector::datais defined in C+11, so Microsoft Visual C++ 9.0 (aka Visual Studio 2008) does not support it and raises the following error:The (uglier) method
&vector[0]could be used instead ofvector.data()to get the pointer to the underlying array (provided it isn't empty).As you know, Python 2.7 for Windows is still compiled with Visual Studio 2008, so all extension modules should in theory be compiled using the same MSVC compiler version. After VS2008 was discontinued, Microsoft released an ad-hoc "Visual C++ Compiler for Python 2.7" (http://aka.ms/vcpython27) meant to be used for compiling extension for Windows Python 2.7.
In the current Brotli's
setup.py, I added a patch to force distutils use Visual Studio 2010 for Python 2.7. This seems to work well so far, despite many people warn against mixing different C runtimes versions between the interpreter and the extension modules.Since you recently added support for C++98, it'd be nice to also try support the old Microsoft compiler.
Thank you.
@anthrotype commented on GitHub (Oct 5, 2015):
thank you very much!