Re: [PATCH 0/4] Allow specifying alternate names for addresses in other_email
[notmuch-archives.git] / 26 / 311ff3af8099101d96e5b50212fafd2329a8bd
1 Return-Path: <too@guru-group.fi>\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 arlo.cworth.org (Postfix) with ESMTP id 34B366DE01F7\r
6  for <notmuch@notmuchmail.org>; Tue,  1 Mar 2016 11:30:08 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0.307\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.307 tagged_above=-999 required=5 tests=[AWL=0.316, \r
12  HEADER_FROM_DIFFERENT_DOMAINS=0.001, T_RP_MATCHES_RCVD=-0.01]\r
13  autolearn=disabled\r
14 Received: from arlo.cworth.org ([127.0.0.1])\r
15  by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
16  with ESMTP id WyoYyzqGJ8ST for <notmuch@notmuchmail.org>;\r
17  Tue,  1 Mar 2016 11:30:05 -0800 (PST)\r
18 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
19  by arlo.cworth.org (Postfix) with ESMTP id 8E5606DE00DF\r
20  for <notmuch@notmuchmail.org>; Tue,  1 Mar 2016 11:30:05 -0800 (PST)\r
21 Received: by guru.guru-group.fi (Postfix, from userid 501)\r
22  id C676A1001A7; Tue,  1 Mar 2016 21:30:09 +0200 (EET)\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>\r
24 To: notmuch@notmuchmail.org\r
25 Cc: tomi.ollila@iki.fi\r
26 Subject: [PATCH v2] lib: NOTMUCH_DEPRECATED macro also for older compilers\r
27 Date: Tue,  1 Mar 2016 21:30:07 +0200\r
28 Message-Id: <1456860607-3523-1-git-send-email-tomi.ollila@iki.fi>\r
29 X-Mailer: git-send-email 2.6.4\r
30 X-BeenThere: notmuch@notmuchmail.org\r
31 X-Mailman-Version: 2.1.20\r
32 Precedence: list\r
33 List-Id: "Use and development of the notmuch mail system."\r
34  <notmuch.notmuchmail.org>\r
35 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
36  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
37 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
38 List-Post: <mailto:notmuch@notmuchmail.org>\r
39 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
40 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
41  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
42 X-List-Received-Date: Tue, 01 Mar 2016 19:30:08 -0000\r
43 \r
44 Some compilers (older than gcc 4.5 and clang 2.9) do support\r
45 __attribute__ ((deprecated)) but not\r
46 __attribute__ ((deprecated("message"))).\r
47 \r
48 Check if clang version is at least 3.0, or gcc version\r
49 is at least 4.5 to define NOTMUCH_DEPRECATED as the\r
50 latter variant above. Otherwise define NOTMUCH_DEPRECATED\r
51 as the former variant above.\r
52 \r
53 For a bit simpler implementation clang 2.9 is not included\r
54 to use the newer variant. It is just one release, and the\r
55 older one works fine. Clang 3.0 was released around 2011-11\r
56 and gcc 5.1 2015-04-22 (therefore newer macro for gcc 4.5+)\r
57 ---\r
58 \r
59 V2 of id:1439303834-27030-1-git-send-email-tomi.ollila@iki.fi\r
60 -- without the namespace problem (and somewhat better commit message).\r
61 \r
62  lib/notmuch.h | 9 +++++++++\r
63  1 file changed, 9 insertions(+)\r
64 \r
65 diff --git a/lib/notmuch.h b/lib/notmuch.h\r
66 index 310a8b8a3132..cb46fc057d3e 100644\r
67 --- a/lib/notmuch.h\r
68 +++ b/lib/notmuch.h\r
69 @@ -59,8 +59,17 @@ NOTMUCH_BEGIN_DECLS\r
70  #define LIBNOTMUCH_MINOR_VERSION       3\r
71  #define LIBNOTMUCH_MICRO_VERSION       0\r
72  \r
73 +\r
74 +#if defined (__clang_major__) && __clang_major__ >= 3 \\r
75 +    || defined (__GNUC__) && __GNUC__ >= 5 \\r
76 +    || defined (__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ >= 5\r
77  #define NOTMUCH_DEPRECATED(major,minor) \\r
78      __attribute__ ((deprecated ("function deprecated as of libnotmuch " #major "." #minor)))\r
79 +#else\r
80 +#define NOTMUCH_DEPRECATED(major,minor) __attribute__ ((deprecated))\r
81 +#endif\r
82 +\r
83 +\r
84  #endif /* __DOXYGEN__ */\r
85  \r
86  /**\r
87 -- \r
88 2.6.4\r
89 \r