Bug 1340910 - pt 1 - Update our Brotli import script to pull release 0.6.0 from upstream. r=glandium

This commit is contained in:
Jonathan Kew 2017-08-09 11:43:52 +01:00
Родитель 18023835cc
Коммит a6860e142e
2 изменённых файлов: 2 добавлений и 43 удалений

Просмотреть файл

@ -1,39 +0,0 @@
diff --git a/tools/bro.cc b/tools/bro.cc
index b254f0ffdb08..30d9858a95b3 100644
--- a/tools/bro.cc
+++ b/tools/bro.cc
@@ -282,29 +282,34 @@ int main(int argc, char** argv) {
FILE* fin = OpenInputFile(input_path);
FILE* fout = OpenOutputFile(output_path, force);
if (decompress) {
Decompresss(fin, fout);
} else {
brotli::BrotliParams params;
params.lgwin = lgwin;
params.quality = quality;
+/* clang-cl doesn't like exceptions */
+#if !defined(_MSC_VER) || !defined(__clang__)
try {
+#endif
brotli::BrotliFileIn in(fin, 1 << 16);
brotli::BrotliFileOut out(fout);
if (!BrotliCompress(params, &in, &out)) {
fprintf(stderr, "compression failed\n");
unlink(output_path);
exit(1);
}
+#if !defined(_MSC_VER) || !defined(__clang__)
} catch (std::bad_alloc&) {
fprintf(stderr, "not enough memory\n");
unlink(output_path);
exit(1);
}
+#endif
}
if (fclose(fin) != 0) {
perror("fclose");
exit(1);
}
if (fclose(fout) != 0) {
perror("fclose");
exit(1);

Просмотреть файл

@ -6,12 +6,12 @@
MY_TEMP_DIR=`mktemp -d -t brotli_update.XXXXXX` || exit 1
git clone https://github.com/google/brotli ${MY_TEMP_DIR}/brotli
git -C ${MY_TEMP_DIR}/brotli checkout v0.4.0
git -C ${MY_TEMP_DIR}/brotli checkout v0.6.0
COMMIT=$(git -C ${MY_TEMP_DIR}/brotli rev-parse HEAD)
perl -p -i -e "s/\[commit [0-9a-f]{40}\]/[commit ${COMMIT}]/" README.mozilla;
DIRS="dec enc tools"
DIRS="common dec enc include tools"
for d in $DIRS; do
rm -rf $d
@ -19,8 +19,6 @@ for d in $DIRS; do
done
rm -rf ${MY_TEMP_DIR}
patch -p1 < clang-cl-exceptions.patch
hg addremove $DIRS
echo "###"