From 3f5cce2fe626a5d769b12c99df5425b22733b4d8 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sun, 17 Oct 2021 21:19:27 +0200 Subject: [PATCH] Avoid using SIZEOF_VOID_P, remove unsused SYS_IS_CYGWIN32 This allows future GAP versions to drop SIZEOF_VOID_P (although 4.12 definitely will support it). --- configure.ac | 5 ----- src/bitarray.h | 2 +- src/homos.c | 6 +----- src/perms.h | 7 ++----- 4 files changed, 4 insertions(+), 16 deletions(-) diff --git a/configure.ac b/configure.ac index d2a84aedf..3058665ae 100644 --- a/configure.ac +++ b/configure.ac @@ -57,11 +57,6 @@ case $host_os in * ) CYGWIN=no;; esac AM_CONDITIONAL([SYS_IS_CYGWIN], [test "$CYGWIN" = "yes"]) -if test "$CYGWIN" = "yes"; then - AC_DEFINE(SYS_IS_CYGWIN32, 1, are we on CYGWIN?) -else - AC_DEFINE(SYS_IS_CYGWIN32, 0, are we on CYGWIN?) -fi dnl ## User setting: Debug mode (off by default) AC_ARG_ENABLE([debug], diff --git a/src/bitarray.h b/src/bitarray.h index 82541b5b0..30e630d39 100644 --- a/src/bitarray.h +++ b/src/bitarray.h @@ -31,7 +31,7 @@ typedef UInt Block; #define MAXVERTS 512 #endif -#if SIZEOF_VOID_P == 8 +#if SYS_IS_64_BIT // To avoid division and mod static size_t const NR_BLOCKS_LOOKUP[MAXVERTS + 1] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, diff --git a/src/homos.c b/src/homos.c index 8d8b905fe..80df1089f 100644 --- a/src/homos.c +++ b/src/homos.c @@ -92,12 +92,8 @@ } \ } -#if SIZEOF_VOID_P == 4 && DIGRAPHS_HAVE___BUILTIN_CTZLL -#undef DIGRAPHS_HAVE___BUILTIN_CTZLL -#endif - // The following macro is bitmap_decode_ctz_callpack from https://git.io/fho4p -#ifdef DIGRAPHS_HAVE___BUILTIN_CTZLL +#if SYS_IS_64_BIT && defined(DIGRAPHS_HAVE___BUILTIN_CTZLL) #define FOR_SET_BITS(__bit_array, __nr_bits, __variable) \ for (size_t k = 0; k < NR_BLOCKS_LOOKUP[__nr_bits]; ++k) { \ Block block = __bit_array->blocks[k]; \ diff --git a/src/perms.h b/src/perms.h index fedbb0111..3cd111a8b 100644 --- a/src/perms.h +++ b/src/perms.h @@ -28,11 +28,8 @@ #define MAXVERTS 512 #define UNDEFINED MAXVERTS + 1 -#if SIZEOF_VOID_P == 8 -#define SMALLINTLIMIT 1152921504606846976 -#else -#define SMALLINTLIMIT 268435456 -#endif +// smallest positive integer that doesn't fit into a small integer object +#define SMALLINTLIMIT (INT_INTOBJ_MAX + 1) typedef uint16_t* Perm;