git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Facing error in git-imap-send while compiling Git

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 21, 2020, 18:11 UTC
Message-ID
<xmqqa76gbrxm.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<CAFFaXsxLd8duDPTE1H-zJiYnTVSB3pHCfBV+08Y4jLvCWR9kNw@mail.gmail.com>
Nirmal Khedkar <nirmalhk7@gmail.com> writes:
Show 26 quoted lines
> the same errors. Here's my diff, in case I have been making mistakes
> all along.
>
>
> ---
> diff --git a/imap-send.c b/imap-send.c
> index 6c54d8c29d..73ed3bc287 100644
> --- a/imap-send.c
> +++ b/imap-send.c
> @@ -42,6 +42,12 @@ typedef void *SSL;
>  #define USE_CURL_DEFAULT 0
>  #endif
>
> +#if OPENSSL_VERSION_NUMBER < 0x10100000L
> +    #define OPENSSL_sk_num(x) sk_GENERAL_NAME_num(x)
> +    #define OPENSSL_sk_value(x,y) sk_GENERAL_NAME_value((x),(y))
> +    #define OPENSSL_sk_pop_free(x,y) sk_GENERAL_NAME_pop_free((x),(y))
> +#endif
> +
>  static int verbosity;
>  static int use_curl = USE_CURL_DEFAULT;
>
> @@ -59,6 +65,8 @@ static struct option imap_send_options[] = {
>  #define DRV_BOX_BAD     -2
>  #define DRV_STORE_BAD   -3
> ---

If the above is the whole change, then I do not think it would work. In the thread I referred you to, I was responding to a patch that has repetitive

	+#if OPENSSL_VERSION_NUMBER < 0x10100000L
		call_this_original_function();
	+#else
	+	call_this_new_function();
	+#endif

and I was merely suggesting to reduce the patch noise by #define'ing a compatibility macro to allow us use new names in the code regardless of the version (i.e. OPENSSL_sk_*() may not be available in older version, which used to call them sk_*()---the solution is to pretend we have OPENSSL_sk_*() by defining them in terms of sk_*() we do have).

There was a hunk (or perhaps two) in the patch I was responding to that is different from the mere function renaming. That part is not there in the above patch you pasted, and needs to be kept, I think.

Previous: Nirmal KhedkarNext: Johannes Schindelin
Message 8 of 14 in “Facing error in git-imap-send while compiling Git”
  1. Nirmal KhedkarJan 16, 2020
  2. Junio C HamanoJan 16, 2020
  3. Nirmal KhedkarJan 17, 2020
  4. Johannes SchindelinJan 17, 2020
  5. Nirmal KhedkarJan 20, 2020
  6. Johannes SchindelinJan 20, 2020
  7. Nirmal KhedkarJan 21, 2020
  8. Junio C HamanoJan 21, 2020
  9. Johannes SchindelinJan 21, 2020
  10. Junio C HamanoJan 22, 2020
  11. Nirmal KhedkarJan 30, 2020
  12. Beat BolliJan 30, 2020
  13. Johannes SchindelinFeb 1, 2020
  14. Nirmal KhedkarFeb 15, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.