Author: Michał Górny <mgorny@gentoo.org>
Description: update make_cffi.py to skip type alias macros in zstd 1.5.7
Forwarded: https://github.com/indygreg/python-zstandard/pull/255
--- a/make_cffi.py
+++ b/make_cffi.py
@@ -179,7 +179,7 @@
     include_dirs=INCLUDE_DIRS,
 )

-DEFINE = re.compile(b"^\\#define ([a-zA-Z0-9_]+) ")
+DEFINE = re.compile(rb"^#define\s+([a-zA-Z0-9_]+)\s+(\S+)")

 sources = []

@@ -204,9 +204,14 @@
             if m.group(1) in (b"ZSTD_LIB_VERSION", b"ZSTD_VERSION_STRING"):
                 continue

+            # These defines create aliases from old (camelCase) type names
+            # to the new PascalCase names, which breaks CFFI.
+            if m.group(1).lower() == m.group(2).lower():
+                continue
+
             # The ... is magic syntax by the cdef parser to resolve the
             # value at compile time.
-            sources.append(m.group(0) + b" ...")
+            sources.append(b"#define " + m.group(1) + b" ...")

 cdeflines = b"\n".join(sources).splitlines()
 cdeflines = [l for l in cdeflines if l.strip()]
