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.
 #ifndef NOTMUCH_COMPAT_H
 #define NOTMUCH_COMPAT_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #if !HAVE_GETLINE
 #include <stdio.h>
 #include <unistd.h>
 char* strcasestr(const char *haystack, const char *needle);
 #endif /* !HAVE_STRCASESTR */
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* NOTMUCH_COMPAT_H */