[PR #201] replace vector.data() with &vector[0] for MSVC90 compatibility #801

Closed
opened 2026-01-29 20:50:57 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/google/brotli/pull/201

State: closed
Merged: Yes


This patch is meant to address issue #200, by replacing all uses of vector.data() with &vector[0].

I also removed the distutils patch inside setup.py, so that the correct MSVC compiler version is selected automatically based on the python version (9.0 for Py2.7, 10.0 for Python 3.4, etc.)

The import setuptools at the beginning of setup.py is required to use the "MS Visual C++ for Python 2.7" (http://aka.ms/vcpython27). Unfortunately the stock distutils fails to locate the vcvarsall.bat file..
This issue is fixed in setuptools (which is now bundled along with pip with the latest Python.org installers, and is the recommended way to distribute Python packages).

I know it looks terrible -- but at least shows how with little change we can make it work even with MSVC 9.0 and Windows Python 2.7.

Let me know what you think.
Thanks

**Original Pull Request:** https://github.com/google/brotli/pull/201 **State:** closed **Merged:** Yes --- This patch is meant to address issue #200, by replacing all uses of `vector.data()` with `&vector[0]`. I also removed the distutils patch inside setup.py, so that the correct MSVC compiler version is selected automatically based on the python version (9.0 for Py2.7, 10.0 for Python 3.4, etc.) The `import setuptools` at the beginning of setup.py is required to use the "MS Visual C++ for Python 2.7" (http://aka.ms/vcpython27). Unfortunately the stock distutils fails to locate the `vcvarsall.bat` file.. This issue is fixed in setuptools (which is now bundled along with pip with the latest Python.org installers, and is the recommended way to distribute Python packages). I know it looks terrible -- but at least shows how with little change we can make it work even with MSVC 9.0 and Windows Python 2.7. Let me know what you think. Thanks
claunia added the pull-request label 2026-01-29 20:50:57 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/brotli#801