]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
factor: be more cautious about C compiler versions
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 12 May 2025 01:22:44 +0000 (18:22 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 12 May 2025 08:28:48 +0000 (01:28 -0700)
* src/factor.c (__GMP_GNUC_PREREQ): Define compatibly with GMP.

src/factor.c

index d07ab9419c29572770b5218a87d15f2b557f5ea0..8767bbe9a80b1958c10010a8a35b8d5c6ccaaf1e 100644 (file)
@@ -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.