]> git.notmuchmail.org Git - notmuch/commitdiff
fix build failure with glib 2.67
authorDavid Bremner <david@tethera.net>
Mon, 15 Feb 2021 20:43:50 +0000 (16:43 -0400)
committerDavid Bremner <david@tethera.net>
Mon, 15 Feb 2021 20:43:50 +0000 (16:43 -0400)
Based on a patch from Michael J Gruber [1].  As of glib 2.67 (more
specifically [2]), including "gmime-extra.h" inside an extern "C"
block causes build failures, because glib is using C++ features.

Observing that "gmime-extra.h" is no longer needed in
notmuch-private.h, which can simply delete that include, but
we have to correspondingly move the includes which might include
it (in particular crypto.h) out of the extern "C" block also.

This seems less fragile than only moving gmime-extra, and relying on
preprocessor sentinels to keep the deeper includes from happening.

Move to the include to the outside of the extern block.

[1]: id:aee618a3d41f7889a7449aa16893e992325a909a.1613055071.git.git@grubix.eu
[2]: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1715

lib/notmuch-private.h

index 57ec7f72eae530b8aa82efb6598065382947064f..41aff34273da26ebc25b767929a405deb292accd 100644 (file)
 
 #include "notmuch.h"
 
+#include "xutil.h"
+#include "error_util.h"
+#include "string-util.h"
+#include "crypto.h"
+#include "repair.h"
+
 NOTMUCH_BEGIN_DECLS
 
 #include <stdlib.h>
@@ -47,14 +53,6 @@ NOTMUCH_BEGIN_DECLS
 
 #include <talloc.h>
 
-#include "gmime-extra.h"
-
-#include "xutil.h"
-#include "error_util.h"
-#include "string-util.h"
-#include "crypto.h"
-#include "repair.h"
-
 #ifdef DEBUG
 # define DEBUG_DATABASE_SANITY 1
 # define DEBUG_THREADING 1