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

Re: [PATCH 2/4] git-imap-send: Add support for SSL.

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 10, 2008, 01:20 UTC
Message-ID
<7v8wwa5ycf.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<1215638942-25010-2-git-send-email-robertshearman@gmail.com>
Robert Shearman <robertshearman@gmail.com> writes:
Show 14 quoted lines
> diff --git a/imap-send.c b/imap-send.c
> index 24d76a7..26d1dba 100644
> --- a/imap-send.c
> +++ b/imap-send.c
> @@ -23,6 +23,12 @@
>   */
>  
>  #include "cache.h"
> +#ifdef NO_OPENSSL
> +typedef void *SSL;
> +#else
> +# include <openssl/ssl.h>
> +# include <openssl/err.h>
> +#endif

This unfortunately is causing compilation issues. <openssl/ssl.h> wants to include <ctype.h> and gets upset by seeing our isalpha() and friends that are defined indirectly in "cache.h" expanded.

In <ctype.h> (on FC9), isCHARACTERISTC() are defined like this:
	#define __exctype(name) extern int name (int) __THROW
	...
        __exctype (isalnum);
        __exctype (isalpha);

but we have been using our own locale agonistic and signed-chars safe macros defined in git-compat-util.h. Including <ctype.h> breaks at the syntax level, but more importantly if the system <ctype.h> redefines isalpha() and friends as macro, then it would break _our_ code that expect these macros are the sane_ctype[] based ones we have.

A hack like the one attached below would make it "work" but it is too ugly. Probably we need to bite the bullet and rename ours not to collide, so that external library headers can safely include <ctype.h>.

Sigh...
diff --git a/git-compat-util.h b/git-compat-util.h
index 8c7e114..0af6406 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -302,6 +302,7 @@ static inline int has_extension(const char *filename, const char *ext)
 }
 
 /* Sane ctype - no locale, and works with signed chars */
+#define _CTYPE_H
 #undef isspace
 #undef isdigit
 #undef isalpha
Previous: Robert ShearmanNext: Linus Torvalds
Message 2 of 5 in “git-imap-send: Add support for SSL.”
  1. 2/4 git-imap-send: Add support for SSL.Robert Shearman, Jul 9, 2008
  2. Junio C HamanoJul 10, 2008
  3. Linus TorvaldsJul 10, 2008
  4. Junio C HamanoJul 10, 2008
  5. Mike HommeyJul 10, 2008

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.