[PATCH] Wrap the compat header in extern "C" { } when compiling C++ sources
authorTomas Carnecky <tom@dbservice.com>
Tue, 27 Apr 2010 17:27:17 +0000 (19:27 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:36:58 +0000 (09:36 -0800)
04/c3950aa5cbfe548dbb3c31a35a3ed8e42b3c6b [new file with mode: 0644]

diff --git a/04/c3950aa5cbfe548dbb3c31a35a3ed8e42b3c6b b/04/c3950aa5cbfe548dbb3c31a35a3ed8e42b3c6b
new file mode 100644 (file)
index 0000000..bdad6aa
--- /dev/null
@@ -0,0 +1,80 @@
+Return-Path: <tomc@caurea.org>\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 6FDAB4196F0\r
+       for <notmuch@notmuchmail.org>; Tue, 27 Apr 2010 10:27:02 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.5\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.5 tagged_above=-999 required=5\r
+       tests=[BAYES_05=-0.5] autolearn=ham\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 095og+YiUl4H for <notmuch@notmuchmail.org>;\r
+       Tue, 27 Apr 2010 10:26:59 -0700 (PDT)\r
+Received: from scotch.caurea.org (ks311007.kimsufi.com [188.165.197.188])\r
+       by olra.theworths.org (Postfix) with ESMTP id AEBBB431FC1\r
+       for <notmuch@notmuchmail.org>; Tue, 27 Apr 2010 10:26:59 -0700 (PDT)\r
+Received: by scotch.caurea.org (Postfix, from userid 101)\r
+       id C09911316C1; Tue, 27 Apr 2010 19:27:18 +0200 (CEST)\r
+From: Tomas Carnecky <tom@dbservice.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] Wrap the compat header in extern "C" { } when compiling C++\r
+       sources\r
+Date: Tue, 27 Apr 2010 19:27:17 +0200\r
+Message-Id: <1272389237-16257-1-git-send-email-tom@dbservice.com>\r
+X-Mailer: git-send-email 1.7.0.5\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: Tue, 27 Apr 2010 17:27:02 -0000\r
+\r
+This fixes a build error on OpenSolaris where the final liking of\r
+notmuch fails because the linker can't find strcasestr() referenced\r
+from thread.cc.\r
+---\r
+\r
+Is it safe to use NOTMUCH_BEGIN/END_DECLS in the compat header? The sha1 header\r
+also uses ifdef __cplusplus instead of that define..\r
+\r
+ compat/compat.h |    8 ++++++++\r
+ 1 files changed, 8 insertions(+), 0 deletions(-)\r
+\r
+diff --git a/compat/compat.h b/compat/compat.h\r
+index 173ef68..7767fe8 100644\r
+--- a/compat/compat.h\r
++++ b/compat/compat.h\r
+@@ -26,6 +26,10 @@\r
+ #ifndef NOTMUCH_COMPAT_H\r
+ #define NOTMUCH_COMPAT_H\r
\r
++#ifdef __cplusplus\r
++extern "C" {\r
++#endif\r
++\r
+ #if !HAVE_GETLINE\r
+ #include <stdio.h>\r
+ #include <unistd.h>\r
+@@ -42,4 +46,8 @@ getdelim (char **lineptr, size_t *n, int delimiter, FILE *fp);\r
+ char* strcasestr(const char *haystack, const char *needle);\r
+ #endif /* !HAVE_STRCASESTR */\r
\r
++#ifdef __cplusplus\r
++}\r
++#endif\r
++\r
+ #endif /* NOTMUCH_COMPAT_H */\r
+-- \r
+1.7.0.5\r
+\r