[PR #207] [MERGED] [types.h] make std integer types for _MSC_VER compatible with CFFI #803

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

📋 Pull Request Information

Original PR: https://github.com/google/brotli/pull/207
Author: @anthrotype
Created: 10/5/2015
Status: Merged
Merged: 10/6/2015
Merged by: @szabadka

Base: masterHead: msvc90-cffi


📝 Commits (1)

  • 66fa4ff [types.h] make std ints types for _MSC_VER compatible with CFFI

📊 Changes

2 files changed (+16 additions, -16 deletions)

View changed files

📝 dec/types.h (+8 -8)
📝 enc/types.h (+8 -8)

📄 Description

CFFI (C Foreign Function Interface for Python) provides an alternative, easier way to call compiled C/C++ code from Python, than using CPython API (like in the current brotlimodule.cc).

I am trying to use CFFI to build Brotli's Python bindings.

Everything works fine, except for another issue related, once again, to MS VC++ 9.0.

As you know, the latter doesn't have stdint.h, so both CFFI and Brotli have to explicitly define the standard integer types when _MSC_VER < 1600.

The problem is the _cffi_inculde.h header file contains slightly different definitions than the ones inlcuded in Brotli's own enc/types.h and dec/types.h

This makes Microsoft Visual C++ 9.0 compiler complain with the following error:

enc\types.h(24) : error C2371: 'int8_t' : redefinition; different basic types
        build\temp.win32-2.7\Release\_brotli_cffi.cpp(179) : see declaration of 'int8_t'

Now, if in enc/types.h and dec/types.h I reuse the same definitions as _cffi_include.h, then MSVC90 is happy and my CFFI extension module can be compiled succesfully.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/google/brotli/pull/207 **Author:** [@anthrotype](https://github.com/anthrotype) **Created:** 10/5/2015 **Status:** ✅ Merged **Merged:** 10/6/2015 **Merged by:** [@szabadka](https://github.com/szabadka) **Base:** `master` ← **Head:** `msvc90-cffi` --- ### 📝 Commits (1) - [`66fa4ff`](https://github.com/google/brotli/commit/66fa4ff403a76791ee226bcd4c9a243c524c36f9) [types.h] make std ints types for _MSC_VER compatible with CFFI ### 📊 Changes **2 files changed** (+16 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `dec/types.h` (+8 -8) 📝 `enc/types.h` (+8 -8) </details> ### 📄 Description [CFFI](https://cffi.readthedocs.org/en/latest/index.html) (C Foreign Function Interface for Python) provides an alternative, easier way to call compiled C/C++ code from Python, than using CPython API (like in the current `brotlimodule.cc`). I am trying to use CFFI to build Brotli's Python bindings. Everything works fine, except for another issue related, once again, to MS VC++ 9.0. As you know, the latter doesn't have `stdint.h`, so both CFFI and Brotli have to explicitly define the standard integer types when `_MSC_VER < 1600`. The problem is the `_cffi_inculde.h` [header file](https://bitbucket.org/cffi/cffi/src/21fef94ca0c88a16b007fb495806d0371b7f878d/cffi/_cffi_include.h?at=default&fileviewer=file-view-default#_cffi_include.h-15) contains slightly different definitions than the ones inlcuded in Brotli's own `enc/types.h` and `dec/types.h` This makes Microsoft Visual C++ 9.0 compiler complain with the following error: ``` enc\types.h(24) : error C2371: 'int8_t' : redefinition; different basic types build\temp.win32-2.7\Release\_brotli_cffi.cpp(179) : see declaration of 'int8_t' ``` Now, if in `enc/types.h` and `dec/types.h` I reuse the same definitions as `_cffi_include.h`, then MSVC90 is happy and my CFFI extension module can be compiled succesfully. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 20:50:58 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/brotli#803