From: Paul Eggert Date: Mon, 12 May 2025 01:22:44 +0000 (-0700) Subject: factor: be more cautious about C compiler versions X-Git-Tag: v9.8~331 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5e35f0e7700dc266375acc8f1f1340f87a4fb2cc;p=thirdparty%2Fcoreutils.git factor: be more cautious about C compiler versions * src/factor.c (__GMP_GNUC_PREREQ): Define compatibly with GMP. --- diff --git a/src/factor.c b/src/factor.c index d07ab9419c..8767bbe9a8 100644 --- a/src/factor.c +++ b/src/factor.c @@ -165,10 +165,17 @@ typedef unsigned long int UDItype; # endif # endif # define LONGLONG_STANDALONE /* Don't require GMP's longlong.h mdep files */ -# define ASSERT(x) /* FIXME make longlong.h really standalone */ -# define __GMP_DECLSPEC /* FIXME make longlong.h really standalone */ + +/* FIXME make longlong.h really standalone, so that ASSERT, __GMP_DECLSPEC + and __GMP_GNUC_PREREQ need not be defined here. */ +# define ASSERT(x) +# define __GMP_DECLSPEC # ifndef __GMP_GNUC_PREREQ -# define __GMP_GNUC_PREREQ(a,b) 1 +# if defined __GNUC__ && defined __GNUC_MINOR__ +# define __GMP_GNUC_PREREQ(a, b) ((a) < __GNUC__ + ((b) <= __GNUC_MINOR__)) +# else +# define __GMP_GNUC_PREREQ(a, b) 0 +# endif # endif /* longlong.h uses these macros only in certain system compiler combinations.