summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Carnecky <tom@dbservice.com>2010-04-27 19:27:17 +0200
committerCarl Worth <cworth@cworth.org>2010-04-27 11:11:11 -0700
commit4b193950a9bf8fb907427526a6191f51e0e2d13c (patch)
treec3cbc5ba5608fa9ba43b711f89caa14f6e4b54c6
parent8fe3ee6f270efae66e7e0287e32f93a9b48c7a32 (diff)
Wrap the compat header in extern "C" { } when compiling C++ sources
This fixes a build error on OpenSolaris where the final liking of notmuch fails because the linker can't find strcasestr() referenced from thread.cc. (cherry picked from commit aab54b4ce752b16725399d1543602ef3f7736c91)
-rw-r--r--compat/compat.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/compat/compat.h b/compat/compat.h
index 173ef68..7767fe8 100644
--- a/compat/compat.h
+++ b/compat/compat.h
@@ -26,6 +26,10 @@
#ifndef NOTMUCH_COMPAT_H
#define NOTMUCH_COMPAT_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#if !HAVE_GETLINE
#include <stdio.h>
#include <unistd.h>
@@ -42,4 +46,8 @@ getdelim (char **lineptr, size_t *n, int delimiter, FILE *fp);
char* strcasestr(const char *haystack, const char *needle);
#endif /* !HAVE_STRCASESTR */
+#ifdef __cplusplus
+}
+#endif
+
#endif /* NOTMUCH_COMPAT_H */