[PATCH v2 1/1] cli: Guard deprecated g_type_init calls
[notmuch-archives.git] / 0a / b9e9f10caa40b907a5cc4a56142a1552d36ce8
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 olra.theworths.org (Postfix) with ESMTP id 14EDA431FAF\r
6         for <notmuch@notmuchmail.org>; Fri,  7 Jun 2013 11:41:33 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         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 eZS5IXdGlj5i for <notmuch@notmuchmail.org>;\r
16         Fri,  7 Jun 2013 11:41:22 -0700 (PDT)\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
18         by olra.theworths.org (Postfix) with ESMTP id 82301431FAE\r
19         for <notmuch@notmuchmail.org>; Fri,  7 Jun 2013 11:41:22 -0700 (PDT)\r
20 Received: by guru.guru-group.fi (Postfix, from userid 501)\r
21         id 8D8DE1001F1; Fri,  7 Jun 2013 21:41:16 +0300 (EEST)\r
22 From: Tomi Ollila <tomi.ollila@iki.fi>\r
23 To: notmuch@notmuchmail.org\r
24 Subject: [PATCH v2 1/1] cli: Guard deprecated g_type_init calls\r
25 Date: Fri,  7 Jun 2013 21:41:13 +0300\r
26 Message-Id: <1370630473-2033-1-git-send-email-tomi.ollila@iki.fi>\r
27 X-Mailer: git-send-email 1.8.0\r
28 MIME-Version: 1.0\r
29 Content-Type: text/plain; charset=UTF-8\r
30 Content-Transfer-Encoding: 8bit\r
31 Cc: tomi.ollila@iki.fi\r
32 X-BeenThere: notmuch@notmuchmail.org\r
33 X-Mailman-Version: 2.1.13\r
34 Precedence: list\r
35 List-Id: "Use and development of the notmuch mail system."\r
36         <notmuch.notmuchmail.org>\r
37 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
38         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
39 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
40 List-Post: <mailto:notmuch@notmuchmail.org>\r
41 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
42 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
43         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
44 X-List-Received-Date: Fri, 07 Jun 2013 18:41:33 -0000\r
45 \r
46 g_type_init was deprecated in GLib 2.35.1.  In order to compile\r
47 cleanly, guard these with a suitable #if.\r
48 \r
49 (commit msg from https://bugs.freedesktop.org/attachment.cgi?id=73774 )\r
50 ---\r
51 \r
52 v2 of id:1370614090-1715-1-git-send-email-tomi.ollila@iki.fi\r
53 \r
54 database.cc was not caught by my naïve grep g_type_init **/*.c\r
55 (have to learn git grep !)\r
56 \r
57 also added back one newline removed in v1\r
58 \r
59  lib/database.cc | 2 ++\r
60  notmuch.c       | 2 ++\r
61  2 files changed, 4 insertions(+)\r
62 \r
63 diff --git a/lib/database.cc b/lib/database.cc\r
64 index 52ed618..5cc0765 100644\r
65 --- a/lib/database.cc\r
66 +++ b/lib/database.cc\r
67 @@ -649,7 +649,9 @@ notmuch_database_open (const char *path,\r
68      }\r
69  \r
70      /* Initialize the GLib type system and threads */\r
71 +#if !GLIB_CHECK_VERSION(2, 35, 1)\r
72      g_type_init ();\r
73 +#endif\r
74  \r
75      /* Initialize gmime */\r
76      if (! initialized) {\r
77 diff --git a/notmuch.c b/notmuch.c\r
78 index 99ddd6d..45a73ce 100644\r
79 --- a/notmuch.c\r
80 +++ b/notmuch.c\r
81 @@ -291,7 +291,9 @@ main (int argc, char *argv[])\r
82      local = talloc_new (NULL);\r
83  \r
84      g_mime_init (0);\r
85 +#if !GLIB_CHECK_VERSION(2, 35, 1)\r
86      g_type_init ();\r
87 +#endif\r
88  \r
89      /* Globally default to the current output format version. */\r
90      notmuch_format_version = NOTMUCH_FORMAT_CUR;\r
91 -- \r
92 1.8.0\r
93 \r