Re: [PATCH] imap-send.c: fix pointer to be const
On Wed, 2009-10-28 at 10:56 -0700, Junio C Hamano wrote:
Show 30 quoted lines
> Michael J Gruber <git@drmicha.warpmail.net> writes:
>
> > Since this is only about warnings, maybe git 1.7.0 is the right time
> > frame to adjust this to the upcoming standard?
>
> This does not look like "one group wants this way, but the others want
> differently. We have to pick one and sacrifice the other because it is
> impossible to have it both ways"; there is no excuse to bring up 1.7.0 for
> something like this.
>
> Doesn't inclusing "ssl.h" give us some indication whether "const" is
> needed to allow us to use #if/#else/#endif in order to compile with
> headers from either versions? I.e. something like...
>
> diff --git a/imap-send.c b/imap-send.c
> index 3847fd1..a199db8 100644
> --- a/imap-send.c
> +++ b/imap-send.c
> @@ -273,7 +273,11 @@ static int ssl_socket_connect(struct imap_socket *sock, int use_tls_only, int ve
> fprintf(stderr, "SSL requested but SSL support not compiled in\n");
> return -1;
> #else
> +#if (OPENSSL_VERSION_NUMBER >= 0x1000000fL)
> + const SSL_METHOD *meth;
> +#else
> SSL_METHOD *meth;
> +#endif
> SSL_CTX *ctx;
> int ret;
>
It's better than my patch, thanks.