Reed-Solomon (zfec): fixed fec_new fail

With current zfec code, fec_init() needs to be called prior to fec_new(),
otherwise the later one returns NULL.

\+ updated submodule to the current zfec version (requiring fec_init();
but UG will compile with the older zfec version as well)
This commit is contained in:
Martin Pulec
2023-10-05 16:35:29 +02:00
parent 1cbb716198
commit 2af4ace259
3 changed files with 25 additions and 1 deletions

View File

@@ -99,6 +99,13 @@
#define X11_LIB_NAME "libX11.so.6"
#endif
#ifdef HAVE_FEC_INIT
#define restrict __restrict // not a C++ keyword
extern "C" {
#include <fec.h>
}
#endif
#ifdef __linux__
#include <mcheck.h>
#endif
@@ -431,6 +438,10 @@ struct init_data *common_preinit(int argc, char *argv[])
incompatible_features = true;
}
#ifdef HAVE_FEC_INIT
fec_init();
#endif
return new init_data{init};
}