You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by NormW <no...@gknw.net> on 2017/01/24 00:32:30 UTC

httpd-trunk/modules/mod_remoteip.c & C89?...

G/M,
In function:
> static const char *remoteip_enable_proxy_protocol(cmd_parms *cmd, void *config,

my 'compiler' reports line 389 mod_remoteip.c:
>     remoteip_addr_info **rem_list[len_list];
 >                                           ^
"not a valid 'const' expression" even tho 'len_list is defined in the 
previous line. _Playing_ a bit I got the following change to build:

> +#define DEF_LEN_LIST 2
> +    int list_len = DEF_LEN_LIST;
> +    remoteip_addr_info **rem_list[DEF_LEN_LIST];

presumably because the preprocessor gets first look at the code.
On the other hand, it might be a compiler bug.

Lastly, having got the compiler happy, the Linker says I need some 
Winsock vars, so added the following to the NWGNUremoteip file.

> Index: modules/metadata/NWGNUremoteip
> ===================================================================
> --- modules/metadata/NWGNUremoteip      (revision 1779997)
> +++ modules/metadata/NWGNUremoteip      (working copy)
> @@ -182,6 +182,12 @@
>         libc \
>         $(EOLIST)
>
> +# Include the Winsock libraries if Winsock is being used
> +ifndef USE_STDSOCKETS
> +FILES_nlm_modules += ws2_32 \
> +       $(EOLIST)
> +endif
> +
>  #
>  # If the nlm has a msg file, put it's path here
>  #
> @@ -206,6 +212,15 @@
>         @libc.imp \
>         $(EOLIST)
>
> +# Include the Winsock imports if Winsock is being used
> +ifndef USE_STDSOCKETS
> +FILES_nlm_Ximports +=  \
> +       @ws2nlm.imp \
> +       WSAStartupRTags \
> +       WSACleanupRTag \
> +       $(EOLIST)
> +endif
> +
>  #
>  # Any symbols exported to here
>  #


If anyone falls for this I can make a patch of the changes if needed.

Other than the above, all of trunk that NetWare presently builds 
compiles/links without issue.
Norm