httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From NormW <no...@gknw.net>
Subject Mod_brotli, C89 & NetWare - finale
Date Sun, 27 Nov 2016 11:38:27 GMT
G/E,
After some head scratching/bashing and research:

Brotli.lib has several places that use log2(), which was not defined in 
C89 (AFAIK), although the function could be kludged easily enough as it 
uses C89 functions in its own routine.

Although NetWare was derived using a C89 compiler, its math.h shows 
signs of its early development, in that a number of MATHs macro's 
resolve not to values but to LibC functions, which means they can't be 
used in 'const' assignments... hence const XXXX = INFINITY fails to 
compile. (It was on the ToDo list it seems but the ship sank before it 
made the top of the list.) Tweaking math.h while possible, doesn't make 
for much sense, but mod_brotli does at least compile without issue; well 
almost.

The only C89 issue (AFAICT) is the following patch, which should allow 
any other C89 (with a more up to date OS ;-( ) to compile it, which 
NetWare's CW can do for the likes of Apache2, Lua, Zlib, NGHTTP2, OSSL 
and a bunch of others.

> Index: modules/filters/mod_brotli.c
> ===================================================================
> --- modules/filters/mod_brotli.c	(revision 1771539)
> +++ modules/filters/mod_brotli.c	(working copy)
> @@ -240,7 +240,7 @@
>              output = BrotliEncoderTakeOutput(ctx->state, &output_len);
>              ctx->total_out += output_len;
>
> -            b = apr_bucket_transient_create(output, output_len,
> +            b = apr_bucket_transient_create((const char *)output, output_len,
>                                              ctx->bb->bucket_alloc);
>              APR_BRIGADE_INSERT_TAIL(ctx->bb, b);
>
> @@ -289,7 +289,7 @@
>          output = BrotliEncoderTakeOutput(ctx->state, &output_len);
>          ctx->total_out += output_len;
>
> -        b = apr_bucket_heap_create(output, output_len, NULL,
> +        b = apr_bucket_heap_create((const char *)output, output_len, NULL,
>                                     ctx->bb->bucket_alloc);
>          APR_BRIGADE_INSERT_TAIL(ctx->bb, b);
>      }
Norm


Mime
View raw message