From 990835fe90d0abdd544cbc72855ab67b51f1cfd1 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Sat, 26 May 2012 12:23:05 +2000 Subject: [PATCH] Re: [PATCH v4 1/7] cli: use typedef to deal with gmime 2.4/2.6 incompatibility --- 7f/599e24974f58107eddc9466e2416707586f7ce | 129 ++++++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 7f/599e24974f58107eddc9466e2416707586f7ce diff --git a/7f/599e24974f58107eddc9466e2416707586f7ce b/7f/599e24974f58107eddc9466e2416707586f7ce new file mode 100644 index 000000000..44be06701 --- /dev/null +++ b/7f/599e24974f58107eddc9466e2416707586f7ce @@ -0,0 +1,129 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 395EB431FC0 + for ; Fri, 25 May 2012 09:23:10 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.7 +X-Spam-Level: +X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id jV8gsoQEzl5v for ; + Fri, 25 May 2012 09:23:09 -0700 (PDT) +Received: from dmz-mailsec-scanner-3.mit.edu (DMZ-MAILSEC-SCANNER-3.MIT.EDU + [18.9.25.14]) + by olra.theworths.org (Postfix) with ESMTP id 61DD4431FBC + for ; Fri, 25 May 2012 09:23:09 -0700 (PDT) +X-AuditID: 1209190e-b7fd86d0000008b4-46-4fbfb1eb2ea4 +Received: from mailhub-auth-2.mit.edu ( [18.7.62.36]) + by dmz-mailsec-scanner-3.mit.edu (Symantec Messaging Gateway) with SMTP + id 56.49.02228.BE1BFBF4; Fri, 25 May 2012 12:23:07 -0400 (EDT) +Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) + by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id q4PGN6Wo026221; + Fri, 25 May 2012 12:23:07 -0400 +Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91]) + (authenticated bits=0) + (User authenticated as amdragon@ATHENA.MIT.EDU) + by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q4PGN5ap006081 + (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); + Fri, 25 May 2012 12:23:06 -0400 (EDT) +Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77) + (envelope-from ) + id 1SXxI9-0000uw-LW; Fri, 25 May 2012 12:23:05 -0400 +Date: Fri, 25 May 2012 12:23:05 -0400 +From: Austin Clements +To: Jameson Graef Rollins +Subject: Re: [PATCH v4 1/7] cli: use typedef to deal with gmime 2.4/2.6 + incompatibility +Message-ID: <20120525162305.GE11804@mit.edu> +References: <1337812843-14986-1-git-send-email-jrollins@finestructure.net> + <1337812843-14986-2-git-send-email-jrollins@finestructure.net> + <20120525144136.GB11804@mit.edu> + <87wr40s1n4.fsf@servo.finestructure.net> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <87wr40s1n4.fsf@servo.finestructure.net> +User-Agent: Mutt/1.5.21 (2010-09-15) +X-Brightmail-Tracker: + H4sIAAAAAAAAA+NgFmpileLIzCtJLcpLzFFi42IRYrdT0X29cb+/wZJdphZ79nlZXL85k9mB + yePuaS6PZ6tuMQcwRXHZpKTmZJalFunbJXBlvO66wFiwR7CiZ/cFtgbGdr4uRk4OCQETiWm/ + j7NC2GISF+6tZ+ti5OIQEtjHKLH1YzsLhLOBUWLOiQfsEM5JJokv13cxQThLGCUuzX7LDtLP + IqAqcaztMxOIzSagIbFt/3JGEFtEwEyi58sfMJtZQEti68YPQDYHh7BApMTCj5ogYV4BHYlZ + J35DbbvJKNF5ayULREJQ4uTMJywwvTf+vWQC6WUWkJZY/o8DJMwpYCox6/4XsBJRARWJKSe3 + sU1gFJqFpHsWku5ZCN0LGJlXMcqm5Fbp5iZm5hSnJusWJyfm5aUW6Rrr5WaW6KWmlG5iBAU1 + pyTfDsavB5UOMQpwMCrx8LJE7/MXYk0sK67MPcQoycGkJMq7Zd1+fyG+pPyUyozE4oz4otKc + 1OJDjBIczEoivFNXAOV4UxIrq1KL8mFS0hwsSuK8qzR3+wsJpCeWpGanphakFsFkZTg4lCR4 + /YHRKyRYlJqeWpGWmVOCkGbi4AQZzgM03Aukhre4IDG3ODMdIn+KUVFKnFcWJCEAksgozYPr + hSWdV4ziQK8I84aBVPEAExZc9yugwUxAg7c83gsyuCQRISXVwJjCcJ/b7trH9V7zU5pFJIzM + FCq3r7DUDb4zJS6fOeXH2S1LLlSoPI95+vLhrsfF6Y2zFj/WOBmxaK9A5SUrDS7lU3FZBt5z + uRYe0pVlVAz8Yztp8/kOs/2fG78eSj7hYFZmzm4qpxUQnLPS79/M8glrD07hsFZ7q5PvZq+0 + rqphd8SCL/IL/yqxFGckGmoxFxUnAgB+XwjoFQMAAA== +Cc: Notmuch Mail +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Fri, 25 May 2012 16:23:10 -0000 + +Quoth Jameson Graef Rollins on May 25 at 8:47 am: +> On Fri, May 25 2012, Austin Clements wrote: +> >> diff --git a/notmuch-client.h b/notmuch-client.h +> >> index 19b7f01..337409f 100644 +> >> --- a/notmuch-client.h +> >> +++ b/notmuch-client.h +> >> @@ -36,6 +36,8 @@ +> >> * these to check the version number. */ +> >> #ifdef GMIME_MAJOR_VERSION +> >> #define GMIME_ATLEAST_26 +> >> +#else +> >> +typedef GMimeCipherContext GMimeCryptoContext; +> > +> > I like the typedef idea, but I don't think we should overload +> > GMimeCryptoContext like this. If someone is reading through the GMime +> > 2.4 code and sees this, they're going to assume that it's a GMime +> > structure, go looking for it, find that it's only in 2.6 and be +> > baffled. Instead, how about providing a typedef to abstract *both* +> > cases? Something like +> > +> > #ifdef GMIME_MAJOR_VERSION +> > #define GMIME_ATLEAST_26 +> > typedef notmuch_crypto_context_t GMimeCipherContext; +> > #else +> > typedef notmuch_crypto_context_t GMimeCryptoContext; +> > #endif +> +> Hey, Austin. I briefly thought about this, but it seemed kind of heavy +> handed given that I hope these ifdefs will go away in the +> not-too-distant future. Do we really have a lot of gmime 2.4 readers +> that would not have access to gmime 2.6 documentation? I'm pretty sure +> that I would personally end up looking at documentation for both +> versions. +> +> But anyway, if this really is a concern, I guess it's not *that* much +> effort to support a new typedef indefinitely to alleviate any potential +> confusion. +> +> Any other opinions? + +The same thought had crossed my mind, but I figured we could remove +the typedefs once we do drop support for 2.6 and simply replace +notmuch_crypto_context_t with GMimeCipherContext at that point. I +don't think that would require many changes at that point +(GMimeCryptoContext and GMimeCipherContext together appear only eight +times in the current master, and I think your series reduces that even +further), and most of the places it would change would probably also +require stripping out other compatibility code. You probably have a +much better sense for the extent of this than I do, though. -- 2.26.2