[glib/wip/pwithnall/2565-array-preprocessor] tests: Fix compilation failure on msys2-mingw64
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/pwithnall/2565-array-preprocessor] tests: Fix compilation failure on msys2-mingw64
- Date: Thu, 6 Jan 2022 13:25:39 +0000 (UTC)
commit 233611fe421df9dcdf59b50288504519d9a3ee8d
Author: Philip Withnall <pwithnall endlessos org>
Date: Thu Jan 6 13:22:23 2022 +0000
tests: Fix compilation failure on msys2-mingw64
This is a follow-up from commit 995823b9d9, which added the condition
```
```
to the array test. On most platforms, both of those symbols are numeric
literals, but on 64-bit Windows `G_MAXSIZE` includes some widening
casts, which means it can’t be used in a preprocessor condition.
We don’t expose an appropriate symbol in `glibconfig.h` which could be
used instead, but the standard `*_WIDTH` symbols from `limits.h` will be
identical and can be used instead.
Signed-off-by: Philip Withnall <pwithnall endlessos org>
Fixes: #2565
glib/tests/array-test.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/glib/tests/array-test.c b/glib/tests/array-test.c
index 79c5c31c3..284ac0809 100644
--- a/glib/tests/array-test.c
+++ b/glib/tests/array-test.c
@@ -1685,7 +1685,7 @@ pointer_array_steal_index (void)
static void
byte_array_new_take_overflow (void)
{
-#if G_MAXSIZE <= G_MAXUINT
+#if SIZE_WIDTH <= UINT_WIDTH
g_test_skip ("Overflow test requires G_MAXSIZE > G_MAXUINT.");
#else
GByteArray* arr;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]