[PATCH 1/8] lib: Fix talloc not being defined on Cygwin

Vladimir Panteleev notmuch at thecybershadow.net
Tue Aug 22 15:43:32 PDT 2017


From: Vladimir Panteleev <vladimir at thecybershadow.net>

With GNU libc, talloc will not be declared unless _GNU_SOURCE is
defined before including stdio.h. Although this is done in
notmuch-private.h, that file is included after including inttypes.h in
database-private.h. On Cygwin, this apparently leads to including the
header file containing the talloc declaration (before _GNU_SOURCE is
defined), thus causing the notmuch compilation to fail.

* database-private.h: Include notmuch-private.h before including
  inttypes.h.
---
 lib/database-private.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/database-private.h b/lib/database-private.h
index 5555554b..117211c7 100644
--- a/lib/database-private.h
+++ b/lib/database-private.h
@@ -21,6 +21,8 @@
 #ifndef NOTMUCH_DATABASE_PRIVATE_H
 #define NOTMUCH_DATABASE_PRIVATE_H
 
+#include "notmuch-private.h"
+
 /* According to WG14/N1124, a C++ implementation won't provide us a
  * macro like PRIx64 (which gives a printf format string for
  * formatting a uint64_t as hexadecimal) unless we define
@@ -30,8 +32,6 @@
 #define __STDC_FORMAT_MACROS
 #include <inttypes.h>
 
-#include "notmuch-private.h"
-
 #ifdef SILENCE_XAPIAN_DEPRECATION_WARNINGS
 #define XAPIAN_DEPRECATED(D) D
 #endif
-- 
2.13.3



More information about the notmuch mailing list