代码拉取完成,页面将自动刷新
From 420a511e0aa787168c9eb2434c34bc2e405a0d8b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Torsten=20Sch=C3=B6nfeld?= <kaffeetisch@gmx.de>
Date: Sun, 28 Jun 2015 23:06:45 +0200
Subject: [PATCH] Fix GVariant tests on big endian machines
---
GVariant.xs | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/GVariant.xs b/GVariant.xs
index e359829..7fddee8 100644
--- a/GVariant.xs
+++ b/GVariant.xs
@@ -279,10 +279,14 @@ gboolean g_variant_is_container (GVariant *value);
const char * g_variant_classify (GVariant *value);
PREINIT:
- GVariantClass vclass;
+ char vclass_char[2];
CODE:
- vclass = g_variant_classify (value);
- RETVAL = (const char *) &vclass;
+ /* g_variant_classify's return value is of type GVariantClass, which is
+ * probably wider than a char, so we must not treat its address as a
+ * string on big-endian machines. */
+ vclass_char[0] = g_variant_classify (value);
+ vclass_char[1] = 0;
+ RETVAL = vclass_char;
OUTPUT:
RETVAL
--
2.1.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。