/soc/2013/ankitkv/gobjectification: 13124e3f2903: Fix g-ir-scann...

Ankit Vani a at nevitus.org
Thu Feb 6 16:39:39 EST 2014


Changeset: 13124e3f2903073c7bac3cd380eb0dd2529813a8
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2014-02-07 03:04 +0530
Branch:	 soc.2013.gobjectification.plugins
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/13124e3f2903

Description:

Fix g-ir-scanner dying on including Gnt-2.8 in Finch-3.0

diffstat:

 finch/libgnt/gntkeys.h |  49 +++++++++++++++++++++++++++----------------------
 1 files changed, 27 insertions(+), 22 deletions(-)

diffs (59 lines):

diff --git a/finch/libgnt/gntkeys.h b/finch/libgnt/gntkeys.h
--- a/finch/libgnt/gntkeys.h
+++ b/finch/libgnt/gntkeys.h
@@ -69,28 +69,33 @@ extern char *gnt_key_cright;
 #define GNT_KEY_INS    SAFE(key_ic)
 #define GNT_KEY_BACK_TAB ((cur_term && back_tab) ? back_tab : SAFE(key_btab))
 
-#define GNT_KEY_CTRL_A     "\001"
-#define GNT_KEY_CTRL_B     "\002"
-#define GNT_KEY_CTRL_D     "\004"
-#define GNT_KEY_CTRL_E     "\005"
-#define GNT_KEY_CTRL_F     "\006"
-#define GNT_KEY_CTRL_G     "\007"
-#define GNT_KEY_CTRL_H     "\010"
-#define GNT_KEY_CTRL_I     "\011"
-#define GNT_KEY_CTRL_J     "\012"
-#define GNT_KEY_CTRL_K     "\013"
-#define GNT_KEY_CTRL_L     "\014"
-#define GNT_KEY_CTRL_M     "\012"
-#define GNT_KEY_CTRL_N     "\016"
-#define GNT_KEY_CTRL_O     "\017"
-#define GNT_KEY_CTRL_P     "\020"
-#define GNT_KEY_CTRL_R     "\022"
-#define GNT_KEY_CTRL_T     "\024"
-#define GNT_KEY_CTRL_U     "\025"
-#define GNT_KEY_CTRL_V     "\026"
-#define GNT_KEY_CTRL_W     "\027"
-#define GNT_KEY_CTRL_X     "\030"
-#define GNT_KEY_CTRL_Y     "\031"
+/* This is needed so that g-ir-scanner does not take GNT_KEY_CTRL_* as
+   constants -- because if it does, the .gir contains the following invalid XML
+   characters, and parsing explodes */
+#define CONST(x) x
+
+#define GNT_KEY_CTRL_A     CONST("\001")
+#define GNT_KEY_CTRL_B     CONST("\002")
+#define GNT_KEY_CTRL_D     CONST("\004")
+#define GNT_KEY_CTRL_E     CONST("\005")
+#define GNT_KEY_CTRL_F     CONST("\006")
+#define GNT_KEY_CTRL_G     CONST("\007")
+#define GNT_KEY_CTRL_H     CONST("\010")
+#define GNT_KEY_CTRL_I     CONST("\011")
+#define GNT_KEY_CTRL_J     CONST("\012")
+#define GNT_KEY_CTRL_K     CONST("\013")
+#define GNT_KEY_CTRL_L     CONST("\014")
+#define GNT_KEY_CTRL_M     CONST("\012")
+#define GNT_KEY_CTRL_N     CONST("\016")
+#define GNT_KEY_CTRL_O     CONST("\017")
+#define GNT_KEY_CTRL_P     CONST("\020")
+#define GNT_KEY_CTRL_R     CONST("\022")
+#define GNT_KEY_CTRL_T     CONST("\024")
+#define GNT_KEY_CTRL_U     CONST("\025")
+#define GNT_KEY_CTRL_V     CONST("\026")
+#define GNT_KEY_CTRL_W     CONST("\027")
+#define GNT_KEY_CTRL_X     CONST("\030")
+#define GNT_KEY_CTRL_Y     CONST("\031")
 
 #define GNT_KEY_F1         SAFE(key_f1)
 #define GNT_KEY_F2         SAFE(key_f2)



More information about the Commits mailing list