3rdparty: bzip2: properly use stdio-free version, don't include tests and utils to the build

This commit is contained in:
Alibek Omarov 2024-10-08 15:39:56 +03:00
parent 4d8cb0469f
commit 38c0dc4551
2 changed files with 48 additions and 1 deletions

View file

@ -21,8 +21,10 @@ def build(bld):
# BZ_VERSION='1.1.0-fwgs'
# )
bz_sources = ['bzip2/blocksort.c', 'bzip2/huffman.c', 'bzip2/crctable.c', 'bzip2/randtable.c', 'bzip2/compress.c', 'bzip2/decompress.c', 'bzip2/bzlib.c']
bld.stlib(
source = bld.path.ant_glob(['bzip2/*.c']),
source = bz_sources,
target = 'bzip2',
# use = 'bz_version.h',
features = 'c',

View file

@ -104,6 +104,51 @@ const char *ns_strings[NS_COUNT] =
"Server",
};
void bz_internal_error( int errcode );
void bz_internal_error( int errcode )
{
Con_Printf( S_ERROR "bzip2/libbzip2: internal error number %d.\n"
"This is a bug in bzip2/libbzip2, %s.\n"
"Please report it at: https://gitlab.com/bzip2/bzip2/-/issues\n"
"If this happened when you were using some program which uses\n"
"libbzip2 as a component, you should also report this bug to\n"
"the author(s) of that program.\n"
"Please make an effort to report this bug;\n"
"timely and accurate bug reports eventually lead to higher\n"
"quality software. Thanks.\n\n",
errcode, BZ2_bzlibVersion( ));
if (errcode == 1007) {
Con_Printf(
"\n*** A special note about internal error number 1007 ***\n"
"\n"
"Experience suggests that a common cause of i.e. 1007\n"
"is unreliable memory or other hardware. The 1007 assertion\n"
"just happens to cross-check the results of huge numbers of\n"
"memory reads/writes, and so acts (unintendedly) as a stress\n"
"test of your memory system.\n"
"\n"
"I suggest the following: try compressing the file again,\n"
"possibly monitoring progress in detail with the -vv flag.\n"
"\n"
"* If the error cannot be reproduced, and/or happens at different\n"
" points in compression, you may have a flaky memory system.\n"
" Try a memory-test program. I have used Memtest86\n"
" (www.memtest86.com). At the time of writing it is free (GPLd).\n"
" Memtest86 tests memory much more thorougly than your BIOSs\n"
" power-on test, and may find failures that the BIOS doesn't.\n"
"\n"
"* If the error can be repeatably reproduced, this is a bug in\n"
" bzip2, and I would very much like to hear about it. Please\n"
" let me know, and, ideally, save a copy of the file causing the\n"
" problem -- without which I will be unable to investigate it.\n"
"\n"
);
}
Sys_Error( "bzip2/libbzip2: internal error number %d\n", errcode );
}
/*
=================================