1 Return-Path: <jani@nikula.org>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id BEEF2429E5A
\r
6 for <notmuch@notmuchmail.org>; Wed, 6 Nov 2013 11:01:54 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id 971tZOADL14V for <notmuch@notmuchmail.org>;
\r
16 Wed, 6 Nov 2013 11:01:47 -0800 (PST)
\r
17 Received: from mail-ee0-f53.google.com (mail-ee0-f53.google.com
\r
18 [74.125.83.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client
\r
19 certificate requested) by olra.theworths.org (Postfix) with ESMTPS id
\r
20 0C62A429E53 for <notmuch@notmuchmail.org>; Wed, 6 Nov 2013 11:01:46 -0800
\r
22 Received: by mail-ee0-f53.google.com with SMTP id e51so2781551eek.12
\r
23 for <notmuch@notmuchmail.org>; Wed, 06 Nov 2013 11:01:45 -0800 (PST)
\r
24 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
\r
25 d=1e100.net; s=20130820;
\r
26 h=x-gm-message-state:from:to:cc:subject:date:message-id;
\r
27 bh=WeA/q4IO17MWeV098NP4+fVNyYmizvN1vtdbwFUwrxI=;
\r
28 b=H+dJhEIVD9naL/k5+XlrKQyp7SPevqIL7KTB/35Sq6nkl+1//BfXIm+s0TOsYa/mIN
\r
29 5sNqoV66prIngq2jq9xSnyKlt60CrZkxkANjW3LvJl1mOxO0L+cF06UEeReA4UkJKmdn
\r
30 e7WKEmuHFCLOTkmWrThvWgDQuN724uk6YGElDT01ZoNpmK0MvNUBQV9XShn2odejNumZ
\r
31 s4mu02zVOs83YE2yiWd8dR04R0DWqqTdJxvvdw5n710cAjsP1f5de5YgL6WMU+Vc/ar1
\r
32 bbCfrieP5+eugWv6j5kAARaEN8vFZOE+lyuBagRbzJ00zQIsJpPuN0yai7XpEYtVXqiu
\r
35 ALoCoQnf4uALkFl2SJX/EhK2KkjT6srgqvQaao7SYNarFN85qqVVOniUPFDxv231UjT8ax4ZiGtN
\r
36 X-Received: by 10.14.1.130 with SMTP id 2mr5460498eed.24.1383764504484;
\r
37 Wed, 06 Nov 2013 11:01:44 -0800 (PST)
\r
38 Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi.
\r
40 by mx.google.com with ESMTPSA id 8sm45841004eem.15.2013.11.06.11.01.42
\r
41 for <multiple recipients>
\r
42 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
\r
43 Wed, 06 Nov 2013 11:01:43 -0800 (PST)
\r
44 From: Jani Nikula <jani@nikula.org>
\r
45 To: notmuch@notmuchmail.org
\r
46 Subject: [PATCH] lib: add library version check macro
\r
47 Date: Wed, 6 Nov 2013 21:01:41 +0200
\r
48 Message-Id: <1383764501-18973-1-git-send-email-jani@nikula.org>
\r
49 X-Mailer: git-send-email 1.8.4.rc3
\r
50 X-BeenThere: notmuch@notmuchmail.org
\r
51 X-Mailman-Version: 2.1.13
\r
53 List-Id: "Use and development of the notmuch mail system."
\r
54 <notmuch.notmuchmail.org>
\r
55 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
56 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
57 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
58 List-Post: <mailto:notmuch@notmuchmail.org>
\r
59 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
60 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
61 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
62 X-List-Received-Date: Wed, 06 Nov 2013 19:01:54 -0000
\r
64 There have been some plans for making build incompatible changes to
\r
65 the library API. This is inconvenient, but it is much more so without
\r
66 a way to easily conditional build against multiple versions of
\r
69 The macro has been lifted from glib.
\r
71 lib/notmuch.h | 24 ++++++++++++++++++++++++
\r
72 1 file changed, 24 insertions(+)
\r
74 diff --git a/lib/notmuch.h b/lib/notmuch.h
\r
75 index 9dab555..d109a2c 100644
\r
78 @@ -41,6 +41,30 @@ NOTMUCH_BEGIN_DECLS
\r
82 +#define NOTMUCH_MAJOR_VERSION 0
\r
83 +#define NOTMUCH_MINOR_VERSION 17
\r
84 +#define NOTMUCH_MICRO_VERSION 0
\r
87 + * Check the version of the notmuch library being compiled against.
\r
89 + * Return true if the library being compiled against is of the
\r
90 + * specified version or above. For example:
\r
92 + * #if NOTMUCH_CHECK_VERSION(0, 18, 0)
\r
93 + * (code requiring notmuch 0.18 or above)
\r
96 + * NOTMUCH_CHECK_VERSION has been defined since version 0.17.0; you
\r
97 + * can use #if !defined(NOTMUCH_CHECK_VERSION) to check for versions
\r
100 +#define NOTMUCH_CHECK_VERSION (major, minor, micro) \
\r
101 + (NOTMUCH_MAJOR_VERSION > (major) || \
\r
102 + (NOTMUCH_MAJOR_VERSION == (major) && NOTMUCH_MINOR_VERSION > (minor)) || \
\r
103 + (NOTMUCH_MAJOR_VERSION == (major) && NOTMUCH_MINOR_VERSION == (minor) && \
\r
104 + NOTMUCH_MICRO_VERSION >= (micro)))
\r
106 typedef int notmuch_bool_t;
\r
108 /* Status codes used for the return values of most functions.
\r