NormW <no...@gknw.net> writes: > G/E. > Aimed 'our' C89 compiler at mod_brotli as much for interest as anything > technical) and get the following using release 0.5.2 of Brotli: > >> Calling NWGNUmod_brotli >> CC mod_brotli.c >> ### mwccnlm Compiler: >> # File: mod_brotli.c >> # --------------------- >> # 22: #include <brotli/encode.h> >> # Error: ^ >> # the file 'brotli/encode.h' cannot be opened >> # Too many errors printed, aborting program
Hi, Thanks for giving it a look. mod_brotli is targeted against the upcoming 1.0.x series of brotli (with a different include layout than 0.5.2, and with new BrotliEncoderTakeOutput() API that allows zero-copy processing). If you have the time and energy, could you please try this with the latest development snapshot from https://github.com/google/brotli ? >> Calling NWGNUmod_brotli >> GEN obj_release/mod_brotli_cc.opt >> CC mod_brotli.c >> ### mwccnlm Compiler: >> # File: mod_brotli.c >> # --------------------- >> # 240: output = BrotliEncoderTakeOutput(ctx->state, >> &output_len); >> # Error: >> ^ >> # illegal implicit conversion from 'int' to >> # 'const unsigned char *' > > Which I assume is either a C89-ism or CW-ism.. This error happens because 0.5.2 doesn't have the BrotliEncoderTakeOutput() API. As it's undefined, the compiler assumes it returning an int, and that results in the error. > The >>> >>> # ---------------------------------------------------------------- >>> # 30: static const float kInfinity = INFINITY; >>> # Error: ^ >>> # illegal constant expression > > seems more like a C89-ism to me. Unfortunately, this comes from the brotli itself, and would probably require a fix in the upstream: https://github.com/google/brotli/blob/8148001/enc/backward_references.c#L30 Not too sure on what is the issue here. (How does the #define INFINITY look like in your environment? Perhaps, it's specifically designed to prohibit assignment?). One workaround to get past this would be to use the #else part of this code. Regards, Evgeny Kotkov