Re: [PATCH v4 1/7] cli: use typedef to deal with gmime 2.4/2.6 incompatibility
authorAustin Clements <amdragon@MIT.EDU>
Fri, 25 May 2012 16:23:05 +0000 (12:23 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:47:24 +0000 (09:47 -0800)
7f/599e24974f58107eddc9466e2416707586f7ce [new file with mode: 0644]

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