--- /dev/null
+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 E4FF7431FB6\r
+ for <notmuch@notmuchmail.org>; Sun, 13 May 2012 10:19:23 -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 E5s8n4wkl1nD for <notmuch@notmuchmail.org>;\r
+ Sun, 13 May 2012 10:19:22 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-2.mit.edu (DMZ-MAILSEC-SCANNER-2.MIT.EDU\r
+ [18.9.25.13])\r
+ by olra.theworths.org (Postfix) with ESMTP id C42A5431FAE\r
+ for <notmuch@notmuchmail.org>; Sun, 13 May 2012 10:19:22 -0700 (PDT)\r
+X-AuditID: 1209190d-b7fbf6d0000008ba-fc-4fafed19f001\r
+Received: from mailhub-auth-1.mit.edu ( [18.9.21.35])\r
+ by dmz-mailsec-scanner-2.mit.edu (Symantec Messaging Gateway) with SMTP\r
+ id 62.34.02234.91DEFAF4; Sun, 13 May 2012 13:19:21 -0400 (EDT)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+ by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id q4DHJLxv027983; \r
+ Sun, 13 May 2012 13:19:21 -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 q4DHJI6T001659\r
+ (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+ Sun, 13 May 2012 13:19:20 -0400 (EDT)\r
+Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)\r
+ (envelope-from <amdragon@mit.edu>)\r
+ id 1STcRx-0004hq-Of; Sun, 13 May 2012 13:19:17 -0400\r
+Date: Sun, 13 May 2012 13:19:17 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: Tomi Ollila <tomi.ollila@iki.fi>\r
+Subject: Re: [PATCH] ruby: extern linkage portability improvement\r
+Message-ID: <20120513171917.GL11804@mit.edu>\r
+References: <1336669964-24231-1-git-send-email-tomi.ollila@iki.fi>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Content-Disposition: inline\r
+In-Reply-To: <1336669964-24231-1-git-send-email-tomi.ollila@iki.fi>\r
+User-Agent: Mutt/1.5.21 (2010-09-15)\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFmpmleLIzCtJLcpLzFFi42IR4hRV1pV8u97fYOJJa4vrN2cyW7xZOY/V\r
+ gcnj8NeFLB7PVt1iDmCK4rJJSc3JLEst0rdL4MpYcegnU8FCmYrDF3ayNTCeEe9i5OSQEDCR\r
+ mHntHAuELSZx4d56ti5GLg4hgX2MEtfmLWaCcDYwSlw6/ogVwjnJJDFn1h1GCGcJo8StiZeY\r
+ QfpZBFQlprdMYgex2QQ0JLbtX84IYosIqEg8aFvPCmIzC0hLfPvdzARiCws4ShzbdwJoHwcH\r
+ r4COxK4JDiBhIQEnif/X+sDG8AoISpyc+YQFolVL4sa/l0wg5SBjlv/jAAlzCjhLPJnRADZd\r
+ FGjTlJPb2CYwCs1C0j0LSfcshO4FjMyrGGVTcqt0cxMzc4pTk3WLkxPz8lKLdI30cjNL9FJT\r
+ SjcxgsNakncH47uDSocYBTgYlXh4F4iu9xdiTSwrrsw9xCjJwaQkysv9BijEl5SfUpmRWJwR\r
+ X1Sak1p8iFGCg1lJhHf9Q6Acb0piZVVqUT5MSpqDRUmcV1XrnZ+QQHpiSWp2ampBahFMVoaD\r
+ Q0mClw9kqGBRanpqRVpmTglCmomDE2Q4D9BwUZAa3uKCxNzizHSI/ClGRSlx3mqQhABIIqM0\r
+ D64XlnZeMYoDvSLMqw9SxQNMWXDdr4AGMwEN5hdYBzK4JBEhJdXAuFc2WuBZXp/coS/ex1gW\r
+ /tht67TU9+jysEyGELew155zX1kc22Ctdu3vvFubHi87c9V0t/xkyzvL7TkY4j+t/xTCopGu\r
+ NFVEPXGGt5lU6z3dPwf2unwoSetb2c9n3f33lUDwhzmlHAVOmm/N2VdN6eIraaowPOjLEXLA\r
+ 8V+C/wonx0XJpz5tUGIpzkg01GIuKk4EAG/T1+cWAwAA\r
+Cc: 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: Sun, 13 May 2012 17:19:24 -0000\r
+\r
+Quoth Tomi Ollila on May 10 at 8:12 pm:\r
+> Some C compilers are stricter when it comes to (tentative) definition\r
+> of a variable -- in those compilers introducing variable without 'extern'\r
+> keyword always allocates new 'storage' to the variable and linking all\r
+> these modules fails due to duplicate symbols.\r
+> \r
+> This change uses some macro trickery to avoid writing every variable twice.\r
+> \r
+> This is reimplementation of Charlie Allom's patch:\r
+> id:"1336481467-66356-1-git-send-email-charlie@mediasp.com"\r
+> \r
+> combining information from other change made by Ali Polatel.\r
+> ---\r
+> \r
+> Charlie: could you test whether this patch actually work ? :)\r
+> \r
+> Everyone: what do you think of the "hiding extern" macro trick ?\r
+\r
+This seems like a hacky and nonstandard way to do this. Granted, the\r
+standard way to do this---always declare variables extern in .h files\r
+and also give a non-extern definition in exactly one .c file---is more\r
+verbose, but nobody will be surprised or confused by it.\r
+\r
+> bindings/ruby/defs.h | 56 +++++++++++++++++++++++++++----------------------\r
+> bindings/ruby/init.c | 2 +\r
+> 2 files changed, 33 insertions(+), 25 deletions(-)\r
+> \r
+> diff --git a/bindings/ruby/defs.h b/bindings/ruby/defs.h\r
+> index 85d8205..2531760 100644\r
+> --- a/bindings/ruby/defs.h\r
+> +++ b/bindings/ruby/defs.h\r
+> @@ -24,31 +24,37 @@\r
+> #include <ruby.h>\r
+> #include "notmuch.h"\r
+> \r
+> -VALUE notmuch_rb_cDatabase;\r
+> -VALUE notmuch_rb_cDirectory;\r
+> -VALUE notmuch_rb_cFileNames;\r
+> -VALUE notmuch_rb_cQuery;\r
+> -VALUE notmuch_rb_cThreads;\r
+> -VALUE notmuch_rb_cThread;\r
+> -VALUE notmuch_rb_cMessages;\r
+> -VALUE notmuch_rb_cMessage;\r
+> -VALUE notmuch_rb_cTags;\r
+> -\r
+> -VALUE notmuch_rb_eBaseError;\r
+> -VALUE notmuch_rb_eDatabaseError;\r
+> -VALUE notmuch_rb_eMemoryError;\r
+> -VALUE notmuch_rb_eReadOnlyError;\r
+> -VALUE notmuch_rb_eXapianError;\r
+> -VALUE notmuch_rb_eFileError;\r
+> -VALUE notmuch_rb_eFileNotEmailError;\r
+> -VALUE notmuch_rb_eNullPointerError;\r
+> -VALUE notmuch_rb_eTagTooLongError;\r
+> -VALUE notmuch_rb_eUnbalancedFreezeThawError;\r
+> -VALUE notmuch_rb_eUnbalancedAtomicError;\r
+> -\r
+> -ID ID_call;\r
+> -ID ID_db_create;\r
+> -ID ID_db_mode;\r
+> +#ifdef RUBY_INIT_C\r
+> +#define extern\r
+> +#endif\r
+> +\r
+> +extern VALUE notmuch_rb_cDatabase;\r
+> +extern VALUE notmuch_rb_cDirectory;\r
+> +extern VALUE notmuch_rb_cFileNames;\r
+> +extern VALUE notmuch_rb_cQuery;\r
+> +extern VALUE notmuch_rb_cThreads;\r
+> +extern VALUE notmuch_rb_cThread;\r
+> +extern VALUE notmuch_rb_cMessages;\r
+> +extern VALUE notmuch_rb_cMessage;\r
+> +extern VALUE notmuch_rb_cTags;\r
+> +\r
+> +extern VALUE notmuch_rb_eBaseError;\r
+> +extern VALUE notmuch_rb_eDatabaseError;\r
+> +extern VALUE notmuch_rb_eMemoryError;\r
+> +extern VALUE notmuch_rb_eReadOnlyError;\r
+> +extern VALUE notmuch_rb_eXapianError;\r
+> +extern VALUE notmuch_rb_eFileError;\r
+> +extern VALUE notmuch_rb_eFileNotEmailError;\r
+> +extern VALUE notmuch_rb_eNullPointerError;\r
+> +extern VALUE notmuch_rb_eTagTooLongError;\r
+> +extern VALUE notmuch_rb_eUnbalancedFreezeThawError;\r
+> +extern VALUE notmuch_rb_eUnbalancedAtomicError;\r
+> +\r
+> +extern ID ID_call;\r
+> +extern ID ID_db_create;\r
+> +extern ID ID_db_mode;\r
+> +\r
+> +#undef extern\r
+> \r
+> /* RSTRING_PTR() is new in ruby-1.9 */\r
+> #if !defined(RSTRING_PTR)\r
+> diff --git a/bindings/ruby/init.c b/bindings/ruby/init.c\r
+> index 3fe60fb..b2dc7f6 100644\r
+> --- a/bindings/ruby/init.c\r
+> +++ b/bindings/ruby/init.c\r
+> @@ -18,7 +18,9 @@\r
+> * Author: Ali Polatel <alip@exherbo.org>\r
+> */\r
+> \r
+> +#define RUBY_INIT_C\r
+> #include "defs.h"\r
+> +#undef RUBY_INIT_C\r
+> \r
+> /*\r
+> * Document-module: Notmuch\r