should be it

This commit is contained in:
2025-10-24 19:21:19 -05:00
parent a4b23fc57c
commit f09560c7b1
14047 changed files with 3161551 additions and 1 deletions

View File

@@ -0,0 +1,24 @@
# brotli uses a weird c templating mechanism using _inc.h files
# this does not play well with things like amalagamation
# this script inlines the variuos headers
import os
import re
for filename in os.listdir('.'):
if not (filename.endswith('.cpp') or filename.endswith('.h')):
continue
file_lines = open(filename, 'r').readlines()
if '_inc.h' not in '\n'.join(file_lines):
continue
out = open (filename, 'w')
for line in file_lines:
if '#include' in line and '_inc.h' in line:
match = re.search(r'#include\s+"(.+)".*', line).group(1)
include = open(match, 'r').readlines();
out.write(''.join(include))
continue
out.write(line)