git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Robert Shearman <robertshearman@gmail.com>
Cc: git@vger.kernel.org, Robert Shearman <rob@codeweavers.com>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH 2/4] git-imap-send: Add support for SSL.
Date: Wed, 09 Jul 2008 18:20:32 -0700	[thread overview]
Message-ID: <7v8wwa5ycf.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <1215638942-25010-2-git-send-email-robertshearman@gmail.com> (Robert Shearman's message of "Wed, 9 Jul 2008 22:29:00 +0100")

Robert Shearman <robertshearman@gmail.com> writes:

> 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

  reply	other threads:[~2008-07-10  1:22 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-09 21:29 [PATCH 2/4] git-imap-send: Add support for SSL Robert Shearman
2008-07-10  1:20 ` Junio C Hamano [this message]
2008-07-10  1:31   ` Linus Torvalds
2008-07-10  2:02     ` Junio C Hamano
2008-07-10  5:33 ` Mike Hommey
  -- strict thread matches above, loose matches on Subject: below --
2008-07-08 22:18 Robert Shearman
2008-07-08 23:20 ` Junio C Hamano
2008-07-09  2:28   ` Abhijit Menon-Sen
2008-07-09 12:02   ` Rob Shearman
2008-07-09 18:28     ` Junio C Hamano
2008-07-09 15:14 ` Josh Triplett
2008-07-09 21:24   ` Rob Shearman
2008-07-10  6:39     ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7v8wwa5ycf.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=rob@codeweavers.com \
    --cc=robertshearman@gmail.com \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).