[libdazzle] build: more 64-bit preprocessor check fixes
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libdazzle] build: more 64-bit preprocessor check fixes
- Date: Tue, 5 Sep 2017 18:35:57 +0000 (UTC)
commit 8f6201773631c13eb23ab441743559919b3394b0
Author: Christian Hergert <chergert redhat com>
Date: Tue Sep 5 11:35:48 2017 -0700
build: more 64-bit preprocessor check fixes
src/search/dzl-fuzzy-index-cursor.c | 8 ++++++--
tests/test-int-pair.c | 4 ++--
2 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/src/search/dzl-fuzzy-index-cursor.c b/src/search/dzl-fuzzy-index-cursor.c
index 5a63ee3..980fd37 100644
--- a/src/search/dzl-fuzzy-index-cursor.c
+++ b/src/search/dzl-fuzzy-index-cursor.c
@@ -25,6 +25,10 @@
#include "search/dzl-fuzzy-index-private.h"
#include "util/dzl-int-pair.h"
+#if defined(__LP64__) || defined(_WIN64)
+# define DZL_FUZZY_64 1
+#endif
+
struct _DzlFuzzyIndexCursor
{
GObject object;
@@ -87,7 +91,7 @@ pointer_to_float (gpointer ptr)
{
union {
gpointer ptr;
-#if __WORDSIZE == 64
+#ifdef DZL_FUZZY_64
gdouble fval;
#else
gfloat fval;
@@ -102,7 +106,7 @@ float_to_pointer (gfloat fval)
{
union {
gpointer ptr;
-#if __WORDSIZE == 64
+#ifdef DZL_FUZZY_64
gdouble fval;
#else
gfloat fval;
diff --git a/tests/test-int-pair.c b/tests/test-int-pair.c
index 1dd9e15..4643a05 100644
--- a/tests/test-int-pair.c
+++ b/tests/test-int-pair.c
@@ -6,7 +6,7 @@ test_intpair_basic (void)
DzlIntPair *p;
p = dzl_int_pair_new (0, 0);
-#if __WORDSIZE >= 64
+#ifdef DZL_INT_PAIR_64
/* Technically not ANSI as NULL is allowed to be non-zero, but all the
* platforms we support, this is the case.
*/
@@ -40,7 +40,7 @@ test_uintpair_basic (void)
DzlUIntPair *p;
p = dzl_uint_pair_new (0, 0);
-#if __WORDSIZE >= 64
+#ifdef DZL_INT_PAIR_64
/* Technically not ANSI as NULL is allowed to be non-zero, but all the
* platforms we support, this is the case.
*/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]