]> www.ginac.de Git - cln.git/commitdiff
Assume types 'long long int' and 'long double' exist.
authorRichard Kreckel <kreckel@ginac.de>
Sat, 17 Oct 2020 22:23:28 +0000 (00:23 +0200)
committerRichard Kreckel <kreckel@ginac.de>
Sun, 18 Oct 2020 19:31:22 +0000 (21:31 +0200)
The C++11 standard requires in 3.9.1-2 that type 'long long int' exists
and in -8 that type 'long double' exists. So, remove macros HAVE_LONGLONG
and HAVE_LONGDOUBLE. Also, shamelessly update m4/param.m4, m4/intparam.m4,
and m4/floatparam.m4 with code from CLisp.

All this fixes several cross-compilation issues discovered by
Helmut Grohne <helmut@subdivi.de>.

30 files changed:
autoconf/floatparam.c
autoconf/intparam.c
configure.ac
include/cln/complex_class.h
include/cln/config.h.in
include/cln/float.h
include/cln/integer.h
include/cln/integer_class.h
include/cln/io.h
include/cln/lfloat.h
include/cln/number.h
include/cln/object.h
include/cln/rational.h
include/cln/rational_class.h
include/cln/real.h
include/cln/real_class.h
include/cln/types.h
m4/floatparam.m4
m4/intparam.m4
m4/longdouble.m4 [deleted file]
m4/longlong.m4 [deleted file]
m4/param.m4
src/base/cl_low.h
src/base/digit/cl_D.h
src/base/digitseq/cl_DS_mul_fftc.h
src/base/digitseq/cl_DS_mul_fftcs.h
src/base/digitseq/cl_DS_mul_fftr.h
src/base/low/cl_low_isqrt.cc
src/base/output/cl_output_dec.cc
src/base/output/cl_output_hex.cc

index 66b4d6122dac34628bfd23431d61ac5bfee985fd..db3e6267e4dfede1df77095216df75a81efb51e6 100644 (file)
@@ -9,9 +9,7 @@ typedef int boolean;
 #define TRUE  1
 #define FALSE 0
 
-#ifdef HAVE_LONGDOUBLE
 typedef long double ldouble;
-#endif
 
 static void header (void)
 {
@@ -81,9 +79,7 @@ static boolean equalfn (volatile type* x, volatile type* y)           \
 
 check(float,"float","float",equal_float,main_float)
 check(double,"double","double",equal_double,main_double)
-#ifdef HAVE_LONGDOUBLE
 check(ldouble,"long_double","long double",equal_ldouble,main_ldouble)
-#endif
 
 /* Some systems (arm/linux) store doubles as little endian but with higher
  * and lower word reversed. */
@@ -104,14 +100,12 @@ static void flipped_double (void)
   printf("\n");
 }
         
-int main()
-{
+int main(int argc, char *argv[])
+{ if (freopen(argc==1 ? "conftest.h" : argv[1], "w", stdout) == NULL) return 1;
   header();
   main_float();
   main_double();
-#ifdef HAVE_LONGDOUBLE
   main_ldouble();
-#endif
   flipped_double();
 
   if (ferror(stdout) || fclose(stdout)) return 1;
index 7988265fff008f000177d823239514e6712efcd5..66cce710eef1e24401c32574f13e6b6750e6a474 100644 (file)
@@ -32,10 +32,8 @@ typedef unsigned char  uchar;
 typedef unsigned short  ushort;
 typedef unsigned /* int */  uint;
 typedef unsigned long  ulong;
-#ifdef HAVE_LONGLONG
 typedef long long  longlong;
 typedef unsigned long long  ulonglong;
-#endif
 typedef int (function)();
 
 static int random_table[256] = /* 2048 zufällige Bits, hier von pi */
@@ -87,10 +85,8 @@ static int char_bitsize, short_bitsize, int_bitsize, long_bitsize;
 static int uchar_bitsize, ushort_bitsize, uint_bitsize, ulong_bitsize;
 static boolean char_uchar_same, short_ushort_same, int_uint_same, long_ulong_same;
 static int pointer_bitsize;
-#ifdef HAVE_LONGLONG
 static int longlong_bitsize, ulonglong_bitsize;
 static boolean longlong_ulonglong_same;
-#endif
 
 void main1(void) {
 #define get_unsigned_integer_bitsize(type,where)  \
@@ -140,10 +136,8 @@ void main1(void) {
   print_integer_bitsize(short,"short",short_bitsize);
   print_integer_bitsize(int,"int",int_bitsize);
   print_integer_bitsize(long,"long",long_bitsize);
-#ifdef HAVE_LONGLONG
   get_signed_integer_bitsize(longlong,ulonglong,longlong_bitsize);
   print_integer_bitsize(longlong,"long long",longlong_bitsize);
-#endif
   get_unsigned_integer_bitsize(uchar,uchar_bitsize);
   get_unsigned_integer_bitsize(ushort,ushort_bitsize);
   get_unsigned_integer_bitsize(uint,uint_bitsize);
@@ -152,10 +146,8 @@ void main1(void) {
   print_integer_bitsize(ushort,"unsigned short",ushort_bitsize);
   print_integer_bitsize(uint,"unsigned int",uint_bitsize);
   print_integer_bitsize(ulong,"unsigned long",ulong_bitsize);
-#ifdef HAVE_LONGLONG
   get_unsigned_integer_bitsize(ulonglong,ulonglong_bitsize);
   print_integer_bitsize(ulonglong,"unsigned long long",ulonglong_bitsize);
-#endif
 }
 
 void main2(void) {
@@ -167,9 +159,7 @@ void main2(void) {
   compare_integer_bitsizes("short","unsigned short",short_bitsize,ushort_bitsize);
   compare_integer_bitsizes("int","unsigned int",int_bitsize,uint_bitsize);
   compare_integer_bitsizes("long","unsigned long",long_bitsize,ulong_bitsize);
-#ifdef HAVE_LONGLONG
   compare_integer_bitsizes("long long","unsigned long long",longlong_bitsize,ulonglong_bitsize);
-#endif
 }
 
 #define get_a_random(type,bitsize,where)  \
@@ -221,9 +211,7 @@ void main3(void) {
   compare_integer_representation(short,ushort,"short","unsigned short",short_bitsize,ushort_bitsize,short_ushort_same);
   compare_integer_representation(int,uint,"int","unsigned int",int_bitsize,uint_bitsize,int_uint_same);
   compare_integer_representation(long,ulong,"long","unsigned long",long_bitsize,ulong_bitsize,long_ulong_same);
-#ifdef HAVE_LONGLONG
   compare_integer_representation(longlong,ulonglong,"long long","unsigned long long",longlong_bitsize,ulonglong_bitsize,longlong_ulonglong_same);
-#endif
   printf("\n");
 }
 
@@ -296,16 +284,12 @@ void main4(void) {
   test_integer_ushift(ushort,"unsigned short",ushort_bitsize);
   test_integer_ushift(uint,"unsigned int",uint_bitsize);
   test_integer_ushift(ulong,"unsigned long",ulong_bitsize);
-#ifdef HAVE_LONGLONG
   test_integer_ushift(ulonglong,"unsigned long long",ulonglong_bitsize);
-#endif
   test_integer_sshift(schar,"char",char_bitsize);
   test_integer_sshift(short,"short",short_bitsize);
   test_integer_sshift(int,"int",int_bitsize);
   test_integer_sshift(long,"long",long_bitsize);
-#ifdef HAVE_LONGLONG
   test_integer_sshift(longlong,"long long",longlong_bitsize);
-#endif
 }
 
 void main5(void) {
@@ -357,10 +341,8 @@ void main5(void) {
   test_integer_casts(ushort,short,"unsigned short","short",ushort_bitsize,short_bitsize,0);
   test_integer_casts(uint,int,"unsigned int","int",uint_bitsize,int_bitsize,0);
   test_integer_casts(ulong,long,"unsigned long","long",ulong_bitsize,long_bitsize,0);
-#ifdef HAVE_LONGLONG
   test_integer_casts(longlong,ulonglong,"long long","unsigned long long",longlong_bitsize,ulonglong_bitsize,0);
   test_integer_casts(ulonglong,longlong,"unsigned long long","long long",ulonglong_bitsize,longlong_bitsize,0);
-#endif
   /* dann Casts zwischen Integers unterschiedlicher Größe, aber gleichen Vorzeichens: */
   test_integer_casts(uchar,ushort,"unsigned char","unsigned short",uchar_bitsize,ushort_bitsize,1);
   test_integer_casts(uchar,uint,"unsigned char","unsigned int",uchar_bitsize,uint_bitsize,1);
@@ -368,24 +350,20 @@ void main5(void) {
   test_integer_casts(ushort,uint,"unsigned short","unsigned int",ushort_bitsize,uint_bitsize,1);
   test_integer_casts(ushort,ulong,"unsigned short","unsigned long",ushort_bitsize,ulong_bitsize,1);
   test_integer_casts(uint,ulong,"unsigned int","unsigned long",uint_bitsize,ulong_bitsize,1);
-#ifdef HAVE_LONGLONG
   test_integer_casts(uchar,ulonglong,"unsigned char","unsigned long long",uchar_bitsize,ulonglong_bitsize,1);
   test_integer_casts(ushort,ulonglong,"unsigned short","unsigned long long",ushort_bitsize,ulonglong_bitsize,1);
   test_integer_casts(uint,ulonglong,"unsigned int","unsigned long long",uint_bitsize,ulonglong_bitsize,1);
   test_integer_casts(ulong,ulonglong,"unsigned long","unsigned long long",ulong_bitsize,ulonglong_bitsize,1);
-#endif
   test_integer_casts(schar,short,"char","short",char_bitsize,short_bitsize,2);
   test_integer_casts(schar,int,"char","int",char_bitsize,int_bitsize,2);
   test_integer_casts(schar,long,"char","long",char_bitsize,long_bitsize,2);
   test_integer_casts(short,int,"short","int",short_bitsize,int_bitsize,2);
   test_integer_casts(short,long,"short","long",short_bitsize,long_bitsize,2);
   test_integer_casts(int,long,"int","long",int_bitsize,long_bitsize,2);
-#ifdef HAVE_LONGLONG
   test_integer_casts(schar,longlong,"char","long long",char_bitsize,longlong_bitsize,2);
   test_integer_casts(short,longlong,"short","long long",short_bitsize,longlong_bitsize,2);
   test_integer_casts(int,longlong,"int","long long",int_bitsize,longlong_bitsize,2);
   test_integer_casts(long,longlong,"long","long long",long_bitsize,longlong_bitsize,2);
-#endif
   /* dann Casts zwischen Integers unterschiedlicher Größe und unterschiedlichen Vorzeichens: */
   test_integer_casts(uchar,short,"unsigned char","short",uchar_bitsize,short_bitsize,1);
   test_integer_casts(uchar,int,"unsigned char","int",uchar_bitsize,int_bitsize,1);
@@ -393,24 +371,20 @@ void main5(void) {
   test_integer_casts(ushort,int,"unsigned short","int",ushort_bitsize,int_bitsize,1);
   test_integer_casts(ushort,long,"unsigned short","long",ushort_bitsize,long_bitsize,1);
   test_integer_casts(uint,long,"unsigned int","long",uint_bitsize,long_bitsize,1);
-#ifdef HAVE_LONGLONG
   test_integer_casts(uchar,longlong,"unsigned char","long long",uchar_bitsize,longlong_bitsize,1);
   test_integer_casts(ushort,longlong,"unsigned short","long long",ushort_bitsize,longlong_bitsize,1);
   test_integer_casts(uint,longlong,"unsigned int","long long",uint_bitsize,longlong_bitsize,1);
   test_integer_casts(ulong,longlong,"unsigned long","long long",ulong_bitsize,longlong_bitsize,1);
-#endif
   test_integer_casts(schar,ushort,"char","unsigned short",char_bitsize,ushort_bitsize,2);
   test_integer_casts(schar,uint,"char","unsigned int",char_bitsize,uint_bitsize,2);
   test_integer_casts(schar,ulong,"char","unsigned long",char_bitsize,ulong_bitsize,2);
   test_integer_casts(short,uint,"short","unsigned int",short_bitsize,uint_bitsize,2);
   test_integer_casts(short,ulong,"short","unsigned long",short_bitsize,ulong_bitsize,2);
   test_integer_casts(int,ulong,"int","unsigned long",int_bitsize,ulong_bitsize,2);
-#ifdef HAVE_LONGLONG
   test_integer_casts(schar,ulonglong,"char","unsigned long long",char_bitsize,ulonglong_bitsize,2);
   test_integer_casts(short,ulonglong,"short","unsigned long long",short_bitsize,ulonglong_bitsize,2);
   test_integer_casts(int,ulonglong,"int","unsigned long long",int_bitsize,ulonglong_bitsize,2);
   test_integer_casts(long,ulonglong,"long","unsigned long long",long_bitsize,ulonglong_bitsize,2);
-#endif
 }
 
 void main6(void) {
@@ -486,9 +460,7 @@ void main8(void) {
   get_alignment(short,"short"); get_alignment(ushort,"unsigned short");
   get_alignment(int,"int"); get_alignment(uint,"unsigned int");
   get_alignment(long,"long"); get_alignment(ulong,"unsigned long");
-#ifdef HAVE_LONGLONG
   get_alignment(longlong,"long long"); get_alignment(ulonglong,"unsigned long long");
-#endif
   get_alignment(float,"float");
   get_alignment(double,"double");
   get_alignment(char*,"char *");
@@ -534,9 +506,7 @@ void main9(void) {
   get_endian(ushort,"unsigned short",ushort_bitsize);
   get_endian(uint,"unsigned int",uint_bitsize);
   get_endian(ulong,"unsigned long",ulong_bitsize);
-#ifdef HAVE_LONGLONG
   get_endian(ulonglong,"unsigned long long",ulonglong_bitsize);
-#endif
   printf("\n");
 }
 
@@ -568,8 +538,9 @@ void main10(void)
       printf("#error \"Unknown stack model -- incorrect C semantics!!\"\n");
   }
 
-int main()
-{ main1();
+int main(int argc, char *argv[])
+{ if (freopen(argc==1 ? "conftest.h" : argv[1], "w", stdout) == NULL) return 1;
+  main1();
   main2();
   main3();
   main4();
index 88944b05ebd1210ff2546652bd60bff4432fce26..bdd21dc48b24e1127c455db3c7859ab931d9c932 100644 (file)
@@ -92,11 +92,6 @@ dnl
 AC_LANG([C++])
 AX_CXX_COMPILE_STDCXX([11], [ext], [optional])
 dnl
-CL_LONGLONG
-                      dnl DEFS HAVE_LONGLONG
-CL_LONGDOUBLE
-                      dnl DEFS HAVE_LONGDOUBLE
-dnl
 dnl           checks for header files
 dnl
 AC_CHECK_HEADERS([unistd.h])
index 4e7a774b34b92b269147da67a3a1f5982079dcbf..54cbcf39d19f8abba089a32ddfcae5e96ac39e70 100644 (file)
@@ -21,10 +21,8 @@ public:
        cl_N (const unsigned int);      // argument must be < 2^29
        cl_N (const long);
        cl_N (const unsigned long);
-#ifdef HAVE_LONGLONG
        cl_N (const long long);
        cl_N (const unsigned long long);
-#endif
        cl_N (const float);
        cl_N (const double);
        cl_N& operator= (const int);            // |argument| must be < 2^29
@@ -33,10 +31,8 @@ public:
        cl_N& operator= (const unsigned long);
        cl_N& operator= (const float);
        cl_N& operator= (const double);
-#ifdef HAVE_LONGLONG
        cl_N& operator= (const long long);
        cl_N& operator= (const unsigned long long);
-#endif
 // Other constructors.
        cl_N (const char *);
 // Private constructor.
@@ -64,10 +60,8 @@ CL_DEFINE_INT_CONSTRUCTORS(cl_N)
 CL_DEFINE_INT_ASSIGNMENT_OPERATORS(cl_N)
 CL_DEFINE_LONG_CONSTRUCTORS(cl_N)
 CL_DEFINE_LONG_ASSIGNMENT_OPERATORS(cl_N)
-#ifdef HAVE_LONGLONG
 CL_DEFINE_LONGLONG_CONSTRUCTORS(cl_N)
 CL_DEFINE_LONGLONG_ASSIGNMENT_OPERATORS(cl_N)
-#endif
 CL_DEFINE_FLOAT_CONSTRUCTOR(cl_N)
 CL_DEFINE_DOUBLE_CONSTRUCTOR(cl_N)
 
index 511d534cb7d7ca240ad31705fbf120fbc56fb6cf..78215cea6b7a4d76c1e773f36e20db815bb9aa9b 100644 (file)
@@ -4,13 +4,6 @@
 #include "cln/host_cpu.h"
 #include "cln/version.h"
 
-/* 
- * FIXME: this should not be exposed to user. Or at least it should be
- * renamed to CL_HAVE_LONGLONG or something like that.
- */
-/* compiler supports the `long long' type */
-#undef HAVE_LONGLONG
-
 /* 
  * Numbers in the heap are stored as "digit" (or "limb" in GMP speak)
  * sequences. A digit is an unsigned int with sizeof(void *)*CHAR_BIT bits.
index e3e953fe3c4a3895562bfda2c790d2b8e44cb2d1..0af74e530b2a41be272792399dd8185175fbe911 100644 (file)
@@ -173,12 +173,10 @@ inline const cl_F operator+ (const long x, const cl_F& y)
        { return cl_I(x) + y; }
 inline const cl_F operator+ (const unsigned long x, const cl_F& y)
        { return cl_I(x) + y; }
-#ifdef HAVE_LONGLONG
 inline const cl_F operator+ (const long long x, const cl_F& y)
        { return cl_I(x) + y; }
 inline const cl_F operator+ (const unsigned long long x, const cl_F& y)
        { return cl_I(x) + y; }
-#endif
 inline const cl_F operator+ (const float x, const cl_F& y)
        { return cl_F(x) + y; }
 inline const cl_F operator+ (const double x, const cl_F& y)
@@ -191,12 +189,10 @@ inline const cl_F operator+ (const cl_F& x, const long y)
        { return x + cl_I(y); }
 inline const cl_F operator+ (const cl_F& x, const unsigned long y)
        { return x + cl_I(y); }
-#ifdef HAVE_LONGLONG
 inline const cl_F operator+ (const cl_F& x, const long long y)
        { return x + cl_I(y); }
 inline const cl_F operator+ (const cl_F& x, const unsigned long long y)
        { return x + cl_I(y); }
-#endif
 inline const cl_F operator+ (const cl_F& x, const float y)
        { return x + cl_F(y); }
 inline const cl_F operator+ (const cl_F& x, const double y)
@@ -222,12 +218,10 @@ inline const cl_F operator- (const long x, const cl_F& y)
        { return cl_I(x) - y; }
 inline const cl_F operator- (const unsigned long x, const cl_F& y)
        { return cl_I(x) - y; }
-#ifdef HAVE_LONGLONG
 inline const cl_F operator- (const long long x, const cl_F& y)
        { return cl_I(x) - y; }
 inline const cl_F operator- (const unsigned long long x, const cl_F& y)
        { return cl_I(x) - y; }
-#endif
 inline const cl_F operator- (const float x, const cl_F& y)
        { return cl_F(x) - y; }
 inline const cl_F operator- (const double x, const cl_F& y)
@@ -240,12 +234,10 @@ inline const cl_F operator- (const cl_F& x, const long y)
        { return x - cl_I(y); }
 inline const cl_F operator- (const cl_F& x, const unsigned long y)
        { return x - cl_I(y); }
-#ifdef HAVE_LONGLONG
 inline const cl_F operator- (const cl_F& x, const long long y)
        { return x - cl_I(y); }
 inline const cl_F operator- (const cl_F& x, const unsigned long long y)
        { return x - cl_I(y); }
-#endif
 inline const cl_F operator- (const cl_F& x, const float y)
        { return x - cl_F(y); }
 inline const cl_F operator- (const cl_F& x, const double y)
@@ -283,12 +275,10 @@ inline const cl_R operator* (const long x, const cl_F& y)
        { return cl_I(x) * y; }
 inline const cl_R operator* (const unsigned long x, const cl_F& y)
        { return cl_I(x) * y; }
-#ifdef HAVE_LONGLONG
 inline const cl_R operator* (const long long x, const cl_F& y)
        { return cl_I(x) * y; }
 inline const cl_R operator* (const unsigned long long x, const cl_F& y)
        { return cl_I(x) * y; }
-#endif
 inline const cl_F operator* (const float x, const cl_F& y)
        { return cl_F(x) * y; }
 inline const cl_F operator* (const double x, const cl_F& y)
@@ -301,12 +291,10 @@ inline const cl_R operator* (const cl_F& x, const long y)
        { return x * cl_I(y); }
 inline const cl_R operator* (const cl_F& x, const unsigned long y)
        { return x * cl_I(y); }
-#ifdef HAVE_LONGLONG
 inline const cl_R operator* (const cl_F& x, const long long y)
        { return x * cl_I(y); }
 inline const cl_R operator* (const cl_F& x, const unsigned long long y)
        { return x * cl_I(y); }
-#endif
 inline const cl_F operator* (const cl_F& x, const float y)
        { return x * cl_F(y); }
 inline const cl_F operator* (const cl_F& x, const double y)
@@ -331,12 +319,10 @@ inline const cl_F operator/ (const cl_F& x, const long y)
        { return x / cl_I(y); }
 inline const cl_F operator/ (const cl_F& x, const unsigned long y)
        { return x / cl_I(y); }
-#ifdef HAVE_LONGLONG
 inline const cl_F operator/ (const cl_F& x, const long long y)
        { return x / cl_I(y); }
 inline const cl_F operator/ (const cl_F& x, const unsigned long long y)
        { return x / cl_I(y); }
-#endif
 inline const cl_F operator/ (const cl_F& x, const float y)
        { return x / cl_F(y); }
 inline const cl_F operator/ (const cl_F& x, const double y)
@@ -349,12 +335,10 @@ inline const cl_R operator/ (const long x, const cl_F& y)
        { return cl_I(x) / y; }
 inline const cl_R operator/ (const unsigned long x, const cl_F& y)
        { return cl_I(x) / y; }
-#ifdef HAVE_LONGLONG
 inline const cl_R operator/ (const long long x, const cl_F& y)
        { return cl_I(x) / y; }
 inline const cl_R operator/ (const unsigned long long x, const cl_F& y)
        { return cl_I(x) / y; }
-#endif
 inline const cl_F operator/ (const float x, const cl_F& y)
        { return cl_F(x) / y; }
 inline const cl_F operator/ (const double x, const cl_F& y)
index 081caf2659541d17198fd6e2795c9028463040d4..7b95efd0ac19f920408d6b92ce1c22a1d660bb9e 100644 (file)
@@ -218,12 +218,10 @@ inline const cl_I operator+ (const long x, const cl_I& y)
        { return cl_I(x) + y; }
 inline const cl_I operator+ (const unsigned long x, const cl_I& y)
        { return cl_I(x) + y; }
-#ifdef HAVE_LONGLONG
 inline const cl_I operator+ (const long long x, const cl_I& y)
        { return cl_I(x) + y; }
 inline const cl_I operator+ (const unsigned long long x, const cl_I& y)
        { return cl_I(x) + y; }
-#endif
 inline const cl_I operator+ (const cl_I& x, const int y)
        { return x + cl_I(y); }
 inline const cl_I operator+ (const cl_I& x, const unsigned int y)
@@ -232,12 +230,10 @@ inline const cl_I operator+ (const cl_I& x, const long y)
        { return x + cl_I(y); }
 inline const cl_I operator+ (const cl_I& x, const unsigned long y)
        { return x + cl_I(y); }
-#ifdef HAVE_LONGLONG
 inline const cl_I operator+ (const cl_I& x, const long long y)
        { return x + cl_I(y); }
 inline const cl_I operator+ (const cl_I& x, const unsigned long long y)
        { return x + cl_I(y); }
-#endif
 
 // (- x), wenn x ein Integer ist. Ergebnis Integer.
 extern const cl_I operator- (const cl_I& x);
@@ -253,12 +249,10 @@ inline const cl_I operator- (const long x, const cl_I& y)
        { return cl_I(x) - y; }
 inline const cl_I operator- (const unsigned long x, const cl_I& y)
        { return cl_I(x) - y; }
-#ifdef HAVE_LONGLONG
 inline const cl_I operator- (const long long x, const cl_I& y)
        { return cl_I(x) - y; }
 inline const cl_I operator- (const unsigned long long x, const cl_I& y)
        { return cl_I(x) - y; }
-#endif
 inline const cl_I operator- (const cl_I& x, const int y)
        { return x - cl_I(y); }
 inline const cl_I operator- (const cl_I& x, const unsigned int y)
@@ -267,12 +261,10 @@ inline const cl_I operator- (const cl_I& x, const long y)
        { return x - cl_I(y); }
 inline const cl_I operator- (const cl_I& x, const unsigned long y)
        { return x - cl_I(y); }
-#ifdef HAVE_LONGLONG
 inline const cl_I operator- (const cl_I& x, const long long y)
        { return x - cl_I(y); }
 inline const cl_I operator- (const cl_I& x, const unsigned long long y)
        { return x - cl_I(y); }
-#endif
 
 // (abs x), wenn x ein Integer ist. Ergebnis Integer.
 extern const cl_I abs (const cl_I& x);
@@ -361,12 +353,10 @@ inline const cl_I operator* (const long x, const cl_I& y)
        { return cl_I(x) * y; }
 inline const cl_I operator* (const unsigned long x, const cl_I& y)
        { return cl_I(x) * y; }
-#ifdef HAVE_LONGLONG
 inline const cl_I operator* (const long long x, const cl_I& y)
        { return cl_I(x) * y; }
 inline const cl_I operator* (const unsigned long long x, const cl_I& y)
        { return cl_I(x) * y; }
-#endif
 inline const cl_I operator* (const cl_I& x, const int y)
        { return x * cl_I(y); }
 inline const cl_I operator* (const cl_I& x, const unsigned int y)
@@ -375,12 +365,10 @@ inline const cl_I operator* (const cl_I& x, const long y)
        { return x * cl_I(y); }
 inline const cl_I operator* (const cl_I& x, const unsigned long y)
        { return x * cl_I(y); }
-#ifdef HAVE_LONGLONG
 inline const cl_I operator* (const cl_I& x, const long long y)
        { return x * cl_I(y); }
 inline const cl_I operator* (const cl_I& x, const unsigned long long y)
        { return x * cl_I(y); }
-#endif
 
 // (EXPT x 2), wo x Integer ist.
 extern const cl_I square (const cl_I& x);
index 23f5632ac55f1ca81ee835e1f9be9ef5f4536dda..6c99bda8195864f66143745bea3644b521a2e158 100644 (file)
@@ -21,18 +21,14 @@ public:
        cl_I (const unsigned int);      // argument must be < 2^29
        cl_I (const long);
        cl_I (const unsigned long);
-#ifdef HAVE_LONGLONG
        cl_I (const long long);
        cl_I (const unsigned long long);
-#endif
        cl_I& operator= (const int);            // |argument| must be < 2^29
        cl_I& operator= (const unsigned int);   // argument must be < 2^29
        cl_I& operator= (const long);
        cl_I& operator= (const unsigned long);
-#ifdef HAVE_LONGLONG
        cl_I& operator= (const long long);
        cl_I& operator= (const unsigned long long);
-#endif
 // Other constructors.
        cl_I (const char *);
 // Private constructor.
@@ -59,10 +55,8 @@ CL_DEFINE_INT_CONSTRUCTORS(cl_I)
 CL_DEFINE_INT_ASSIGNMENT_OPERATORS(cl_I)
 CL_DEFINE_LONG_CONSTRUCTORS(cl_I)
 CL_DEFINE_LONG_ASSIGNMENT_OPERATORS(cl_I)
-#ifdef HAVE_LONGLONG
 CL_DEFINE_LONGLONG_CONSTRUCTORS(cl_I)
 CL_DEFINE_LONGLONG_ASSIGNMENT_OPERATORS(cl_I)
-#endif
 
 }  // namespace cln
 
index 45abfda23682f31a15d4a5176fc2eb5d2d9271aa..df9efcbcd32876fddf73810790a911f0630be2db 100644 (file)
@@ -43,10 +43,8 @@ extern void fprintdecimal (std::ostream& stream, int x);
 extern void fprintdecimal (std::ostream& stream, unsigned long x);
 extern void fprintdecimal (std::ostream& stream, long x);
 
-#ifdef HAVE_LONGLONG
 extern void fprintdecimal (std::ostream& stream, unsigned long long x);
 extern void fprintdecimal (std::ostream& stream, long long x);
-#endif
 
 extern void fprinthexadecimal (std::ostream& stream, unsigned int x);
 extern void fprinthexadecimal (std::ostream& stream, int x);
@@ -54,10 +52,8 @@ extern void fprinthexadecimal (std::ostream& stream, int x);
 extern void fprinthexadecimal (std::ostream& stream, unsigned long x);
 extern void fprinthexadecimal (std::ostream& stream, long x);
 
-#ifdef HAVE_LONGLONG
 extern void fprinthexadecimal (std::ostream& stream, unsigned long long x);
 extern void fprinthexadecimal (std::ostream& stream, long long x);
-#endif
 
 
 struct cl_print_flags;
index 80801c894401b09d663c5599b199ec8db7e0fe5b..d619ec3d68a2d72a639d38e966ff071584bc16b8 100644 (file)
@@ -83,12 +83,10 @@ inline const cl_R operator* (const long x, const cl_LF& y)
        { return cl_I(x) * y; }
 inline const cl_R operator* (const unsigned long x, const cl_LF& y)
        { return cl_I(x) * y; }
-#ifdef HAVE_LONGLONG
 inline const cl_R operator* (const long long x, const cl_LF& y)
        { return cl_I(x) * y; }
 inline const cl_R operator* (const unsigned long long x, const cl_LF& y)
        { return cl_I(x) * y; }
-#endif
 inline const cl_R operator* (const cl_LF& x, const int y)
        { return x * cl_I(y); }
 inline const cl_R operator* (const cl_LF& x, const unsigned int y)
@@ -97,12 +95,10 @@ inline const cl_R operator* (const cl_LF& x, const long y)
        { return x * cl_I(y); }
 inline const cl_R operator* (const cl_LF& x, const unsigned long y)
        { return x * cl_I(y); }
-#ifdef HAVE_LONGLONG
 inline const cl_R operator* (const cl_LF& x, const long long y)
        { return x * cl_I(y); }
 inline const cl_R operator* (const cl_LF& x, const unsigned long long y)
        { return x * cl_I(y); }
-#endif
 // Spezialfall x = y.
 // Liefert zu einem Long-Float x : (* x x), ein LF.
 extern const cl_LF square (const cl_LF& x);
@@ -139,12 +135,10 @@ inline const cl_LF operator/ (const cl_LF& x, const long y)
        { return x / cl_I(y); }
 inline const cl_LF operator/ (const cl_LF& x, const unsigned long y)
        { return x / cl_I(y); }
-#ifdef HAVE_LONGLONG
 inline const cl_LF operator/ (const cl_LF& x, const long long y)
        { return x / cl_I(y); }
 inline const cl_LF operator/ (const cl_LF& x, const unsigned long long y)
        { return x / cl_I(y); }
-#endif
 inline const cl_R operator/ (const int x, const cl_LF& y)
        { return cl_I(x) / y; }
 inline const cl_R operator/ (const unsigned int x, const cl_LF& y)
@@ -153,12 +147,10 @@ inline const cl_R operator/ (const long x, const cl_LF& y)
        { return cl_I(x) / y; }
 inline const cl_R operator/ (const unsigned long x, const cl_LF& y)
        { return cl_I(x) / y; }
-#ifdef HAVE_LONGLONG
 inline const cl_R operator/ (const long long x, const cl_LF& y)
        { return cl_I(x) / y; }
 inline const cl_R operator/ (const unsigned long long x, const cl_LF& y)
        { return cl_I(x) / y; }
-#endif
 
 // Liefert zu einem Long-Float x>=0 : (sqrt x), ein LF.
 extern const cl_LF sqrt (const cl_LF& x);
index 8abb22bfd6b600e883373c2abf233b6790c32ce3..67f68899a6926eca49722f012d0a20d159162c57 100644 (file)
@@ -121,7 +121,6 @@ inline _class_& _class_::operator= (const unsigned long wert)               \
 }
 #endif
 
-#ifdef HAVE_LONGLONG
 #if (long_long_bitsize==64)
 // `long' == `sintQ', `unsigned long' == `uintQ'.
 #define CL_DEFINE_LONGLONG_CONSTRUCTORS(_class_)  \
@@ -151,7 +150,6 @@ inline _class_& _class_::operator= (const unsigned long long wert)  \
        return *this;                                                   \
 }
 #endif
-#endif
 
 namespace cln {
 
@@ -205,10 +203,8 @@ public:
        cl_number (const unsigned int); // argument must be < 2^29
        cl_number (const long);
        cl_number (const unsigned long);
-#ifdef HAVE_LONGLONG
        cl_number (const long long);
        cl_number (const unsigned long long);
-#endif
        cl_number (const float);
        cl_number (const double);
        cl_number& operator= (const int);       // |argument| must be < 2^29
@@ -217,10 +213,8 @@ public:
        cl_number& operator= (const unsigned long);
        cl_number& operator= (const float);
        cl_number& operator= (const double);
-#ifdef HAVE_LONGLONG
        cl_number& operator= (const long long);
        cl_number& operator= (const unsigned long long);
-#endif
 // Other constructors.
 //     cl_number (const char *);
 // Private pointer manipulations.
@@ -241,10 +235,8 @@ CL_DEFINE_INT_CONSTRUCTORS(cl_number)
 CL_DEFINE_INT_ASSIGNMENT_OPERATORS(cl_number)
 CL_DEFINE_LONG_CONSTRUCTORS(cl_number)
 CL_DEFINE_LONG_ASSIGNMENT_OPERATORS(cl_number)
-#ifdef HAVE_LONGLONG
 CL_DEFINE_LONGLONG_CONSTRUCTORS(cl_number)
 CL_DEFINE_LONGLONG_ASSIGNMENT_OPERATORS(cl_number)
-#endif
 CL_DEFINE_FLOAT_CONSTRUCTOR(cl_number)
 CL_DEFINE_DOUBLE_CONSTRUCTOR(cl_number)
 
index f6da29f9286aba1b05857c7162351d13c71a33f6..e8c1b9d9ae08b017b0cb9238d7d2b3f2821a9016 100644 (file)
@@ -128,12 +128,10 @@ inline cl_uint cl_combine (cl_uint tag, unsigned long value)
 { return cl_combine_impl(tag, (cl_uint)value); }
 inline cl_uint cl_combine (cl_uint tag, long value)
 { return cl_combine_impl(tag, (cl_sint)value); }
-#ifdef HAVE_LONGLONG
 inline cl_uint cl_combine (cl_uint tag, unsigned long long value)
 { return cl_combine_impl(tag, (cl_uint)value); }
 inline cl_uint cl_combine (cl_uint tag, long long value)
 { return cl_combine_impl(tag, (cl_uint)value); }
-#endif
 
 // Definition of the tags.
 #if !defined(CL_WIDE_POINTERS)
index 08e558a81bb34ffbb86b8a52078b65753b53f1ad..aa9f1412f5d0d69646ee8d776f6a513448bb1059 100644 (file)
@@ -34,12 +34,10 @@ inline const cl_RA operator+ (const long x, const cl_RA& y)
        { return cl_I(x) + y; }
 inline const cl_RA operator+ (const unsigned long x, const cl_RA& y)
        { return cl_I(x) + y; }
-#ifdef HAVE_LONGLONG
 inline const cl_RA operator+ (const long long x, const cl_RA& y)
        { return cl_I(x) + y; }
 inline const cl_RA operator+ (const unsigned long long x, const cl_RA& y)
        { return cl_I(x) + y; }
-#endif
 inline const cl_RA operator+ (const cl_RA& x, const int y)
        { return x + cl_I(y); }
 inline const cl_RA operator+ (const cl_RA& x, const unsigned int y)
@@ -48,12 +46,10 @@ inline const cl_RA operator+ (const cl_RA& x, const long y)
        { return x + cl_I(y); }
 inline const cl_RA operator+ (const cl_RA& x, const unsigned long y)
        { return x + cl_I(y); }
-#ifdef HAVE_LONGLONG
 inline const cl_RA operator+ (const cl_RA& x, const long long y)
        { return x + cl_I(y); }
 inline const cl_RA operator+ (const cl_RA& x, const unsigned long long y)
        { return x + cl_I(y); }
-#endif
 
 // (- r s), wo r und s rationale Zahlen sind.
 extern const cl_RA operator- (const cl_RA& r, const cl_RA& s);
@@ -66,12 +62,10 @@ inline const cl_RA operator- (const long x, const cl_RA& y)
        { return cl_I(x) - y; }
 inline const cl_RA operator- (const unsigned long x, const cl_RA& y)
        { return cl_I(x) - y; }
-#ifdef HAVE_LONGLONG
 inline const cl_RA operator- (const long long x, const cl_RA& y)
        { return cl_I(x) - y; }
 inline const cl_RA operator- (const unsigned long long x, const cl_RA& y)
        { return cl_I(x) - y; }
-#endif
 inline const cl_RA operator- (const cl_RA& x, const int y)
        { return x - cl_I(y); }
 inline const cl_RA operator- (const cl_RA& x, const unsigned int y)
@@ -80,12 +74,10 @@ inline const cl_RA operator- (const cl_RA& x, const long y)
        { return x - cl_I(y); }
 inline const cl_RA operator- (const cl_RA& x, const unsigned long y)
        { return x - cl_I(y); }
-#ifdef HAVE_LONGLONG
 inline const cl_RA operator- (const cl_RA& x, const long long y)
        { return x - cl_I(y); }
 inline const cl_RA operator- (const cl_RA& x, const unsigned long long y)
        { return x - cl_I(y); }
-#endif
 
 // (1+ r), wo r eine rationale Zahl ist.
 extern const cl_RA plus1 (const cl_RA& r);
@@ -141,12 +133,10 @@ inline const cl_RA operator* (const long x, const cl_RA& y)
        { return cl_I(x) * y; }
 inline const cl_RA operator* (const unsigned long x, const cl_RA& y)
        { return cl_I(x) * y; }
-#ifdef HAVE_LONGLONG
 inline const cl_RA operator* (const long long x, const cl_RA& y)
        { return cl_I(x) * y; }
 inline const cl_RA operator* (const unsigned long long x, const cl_RA& y)
        { return cl_I(x) * y; }
-#endif
 inline const cl_RA operator* (const cl_RA& x, const int y)
        { return x * cl_I(y); }
 inline const cl_RA operator* (const cl_RA& x, const unsigned int y)
@@ -155,12 +145,10 @@ inline const cl_RA operator* (const cl_RA& x, const long y)
        { return x * cl_I(y); }
 inline const cl_RA operator* (const cl_RA& x, const unsigned long y)
        { return x * cl_I(y); }
-#ifdef HAVE_LONGLONG
 inline const cl_RA operator* (const cl_RA& x, const long long y)
        { return x * cl_I(y); }
 inline const cl_RA operator* (const cl_RA& x, const unsigned long long y)
        { return x * cl_I(y); }
-#endif
 
 // Quadrat (* r r), wo r eine rationale Zahl ist.
 extern const cl_RA square (const cl_RA& r);
@@ -176,12 +164,10 @@ inline const cl_RA operator/ (const long x, const cl_RA& y)
        { return cl_I(x) / y; }
 inline const cl_RA operator/ (const unsigned long x, const cl_RA& y)
        { return cl_I(x) / y; }
-#ifdef HAVE_LONGLONG
 inline const cl_RA operator/ (const long long x, const cl_RA& y)
        { return cl_I(x) / y; }
 inline const cl_RA operator/ (const unsigned long long x, const cl_RA& y)
        { return cl_I(x) / y; }
-#endif
 inline const cl_RA operator/ (const cl_RA& x, const int y)
        { return x / cl_I(y); }
 inline const cl_RA operator/ (const cl_RA& x, const unsigned int y)
@@ -190,12 +176,10 @@ inline const cl_RA operator/ (const cl_RA& x, const long y)
        { return x / cl_I(y); }
 inline const cl_RA operator/ (const cl_RA& x, const unsigned long y)
        { return x / cl_I(y); }
-#ifdef HAVE_LONGLONG
 inline const cl_RA operator/ (const cl_RA& x, const long long y)
        { return x / cl_I(y); }
 inline const cl_RA operator/ (const cl_RA& x, const unsigned long long y)
        { return x / cl_I(y); }
-#endif
 
 // Return type for rounding operators.
 // x / y  --> (q,r) with x = y*q+r.
@@ -321,10 +305,8 @@ inline cl_RA& operator+= (cl_RA& x, const int y) { return x = x + y; }
 inline cl_RA& operator+= (cl_RA& x, const unsigned int y) { return x = x + y; }
 inline cl_RA& operator+= (cl_RA& x, const long y) { return x = x + y; }
 inline cl_RA& operator+= (cl_RA& x, const unsigned long y) { return x = x + y; }
-#ifdef HAVE_LONGLONG
 inline cl_RA& operator+= (cl_RA& x, const long long y) { return x = x + y; }
 inline cl_RA& operator+= (cl_RA& x, const unsigned long long y) { return x = x + y; }
-#endif
 inline cl_RA& operator++ /* prefix */ (cl_RA& x) { return x = plus1(x); }
 inline void operator++ /* postfix */ (cl_RA& x, int dummy) { (void)dummy; x = plus1(x); }
 inline cl_RA& operator-= (cl_RA& x, const cl_RA& y) { return x = x - y; }
@@ -332,10 +314,8 @@ inline cl_RA& operator-= (cl_RA& x, const int y) { return x = x - y; }
 inline cl_RA& operator-= (cl_RA& x, const unsigned int y) { return x = x - y; }
 inline cl_RA& operator-= (cl_RA& x, const long y) { return x = x - y; }
 inline cl_RA& operator-= (cl_RA& x, const unsigned long y) { return x = x - y; }
-#ifdef HAVE_LONGLONG
 inline cl_RA& operator-= (cl_RA& x, const long long y) { return x = x - y; }
 inline cl_RA& operator-= (cl_RA& x, const unsigned long long y) { return x = x - y; }
-#endif
 inline cl_RA& operator-- /* prefix */ (cl_RA& x) { return x = minus1(x); }
 inline void operator-- /* postfix */ (cl_RA& x, int dummy) { (void)dummy; x = minus1(x); }
 inline cl_RA& operator*= (cl_RA& x, const cl_RA& y) { return x = x * y; }
index 633f7cf16c6b3c26b22f9f97fe2696eeb7614daf..318e731838f6a9766a2e6fdabb84634b0eca767a 100644 (file)
@@ -22,18 +22,14 @@ public:
        cl_RA (const unsigned int);     // argument must be < 2^29
        cl_RA (const long);
        cl_RA (const unsigned long);
-#ifdef HAVE_LONGLONG
        cl_RA (const long long);
        cl_RA (const unsigned long long);
-#endif
        cl_RA& operator= (const int);           // |argument| must be < 2^29
        cl_RA& operator= (const unsigned int);  // argument must be < 2^29
        cl_RA& operator= (const long);
        cl_RA& operator= (const unsigned long);
-#ifdef HAVE_LONGLONG
        cl_RA& operator= (const long long);
        cl_RA& operator= (const unsigned long long);
-#endif
 // Other constructors.
        cl_RA (const char *);
 // Private constructor.
@@ -61,10 +57,8 @@ CL_DEFINE_INT_CONSTRUCTORS(cl_RA)
 CL_DEFINE_INT_ASSIGNMENT_OPERATORS(cl_RA)
 CL_DEFINE_LONG_CONSTRUCTORS(cl_RA)
 CL_DEFINE_LONG_ASSIGNMENT_OPERATORS(cl_RA)
-#ifdef HAVE_LONGLONG
 CL_DEFINE_LONGLONG_CONSTRUCTORS(cl_RA)
 CL_DEFINE_LONGLONG_ASSIGNMENT_OPERATORS(cl_RA)
-#endif
 
 }  // namespace cln
 
index cfcc631f0706b24d29425812a12ed4d9364e683b..b4ef44e39c3cb16132fd7a497b271ddcaff2992c 100644 (file)
@@ -84,12 +84,10 @@ inline const cl_R operator+ (const long x, const cl_R& y)
        { return cl_I(x) + y; }
 inline const cl_R operator+ (const unsigned long x, const cl_R& y)
        { return cl_I(x) + y; }
-#ifdef HAVE_LONGLONG
 inline const cl_R operator+ (const long long x, const cl_R& y)
        { return cl_I(x) + y; }
 inline const cl_R operator+ (const unsigned long long x, const cl_R& y)
        { return cl_I(x) + y; }
-#endif
 inline const cl_F operator+ (const float x, const cl_R& y)
        { return The(cl_F)(cl_R(x) + y); }
 inline const cl_F operator+ (const double x, const cl_R& y)
@@ -102,12 +100,10 @@ inline const cl_R operator+ (const cl_R& x, const long y)
        { return x + cl_I(y); }
 inline const cl_R operator+ (const cl_R& x, const unsigned long y)
        { return x + cl_I(y); }
-#ifdef HAVE_LONGLONG
 inline const cl_R operator+ (const cl_R& x, const long long y)
        { return x + cl_I(y); }
 inline const cl_R operator+ (const cl_R& x, const unsigned long long y)
        { return x + cl_I(y); }
-#endif
 inline const cl_F operator+ (const cl_R& x, const float y)
        { return The(cl_F)(x + cl_R(y)); }
 inline const cl_F operator+ (const cl_R& x, const double y)
@@ -129,12 +125,10 @@ inline const cl_R operator- (const long x, const cl_R& y)
        { return cl_I(x) - y; }
 inline const cl_R operator- (const unsigned long x, const cl_R& y)
        { return cl_I(x) - y; }
-#ifdef HAVE_LONGLONG
 inline const cl_R operator- (const long long x, const cl_R& y)
        { return cl_I(x) - y; }
 inline const cl_R operator- (const unsigned long long x, const cl_R& y)
        { return cl_I(x) - y; }
-#endif
 inline const cl_F operator- (const float x, const cl_R& y)
        { return The(cl_F)(cl_R(x) - y); }
 inline const cl_F operator- (const double x, const cl_R& y)
@@ -147,12 +141,10 @@ inline const cl_R operator- (const cl_R& x, const long y)
        { return x - cl_I(y); }
 inline const cl_R operator- (const cl_R& x, const unsigned long y)
        { return x - cl_I(y); }
-#ifdef HAVE_LONGLONG
 inline const cl_R operator- (const cl_R& x, const long long y)
        { return x - cl_I(y); }
 inline const cl_R operator- (const cl_R& x, const unsigned long long y)
        { return x - cl_I(y); }
-#endif
 inline const cl_F operator- (const cl_R& x, const float y)
        { return The(cl_F)(x - cl_R(y)); }
 inline const cl_F operator- (const cl_R& x, const double y)
@@ -169,12 +161,10 @@ inline const cl_R operator* (const long x, const cl_R& y)
        { return cl_I(x) * y; }
 inline const cl_R operator* (const unsigned long x, const cl_R& y)
        { return cl_I(x) * y; }
-#ifdef HAVE_LONGLONG
 inline const cl_R operator* (const long long x, const cl_R& y)
        { return cl_I(x) * y; }
 inline const cl_R operator* (const unsigned long long x, const cl_R& y)
        { return cl_I(x) * y; }
-#endif
 inline const cl_R operator* (const float x, const cl_R& y)
        { return cl_R(x) * y; }
 inline const cl_R operator* (const double x, const cl_R& y)
@@ -187,12 +177,10 @@ inline const cl_R operator* (const cl_R& x, const long y)
        { return x * cl_I(y); }
 inline const cl_R operator* (const cl_R& x, const unsigned long y)
        { return x * cl_I(y); }
-#ifdef HAVE_LONGLONG
 inline const cl_R operator* (const cl_R& x, const long long y)
        { return x * cl_I(y); }
 inline const cl_R operator* (const cl_R& x, const unsigned long long y)
        { return x * cl_I(y); }
-#endif
 inline const cl_R operator* (const cl_R& x, const float y)
        { return x * cl_R(y); }
 inline const cl_R operator* (const cl_R& x, const double y)
@@ -215,12 +203,10 @@ inline const cl_R operator/ (const long x, const cl_R& y)
        { return cl_I(x) / y; }
 inline const cl_R operator/ (const unsigned long x, const cl_R& y)
        { return cl_I(x) / y; }
-#ifdef HAVE_LONGLONG
 inline const cl_R operator/ (const long long x, const cl_R& y)
        { return cl_I(x) / y; }
 inline const cl_R operator/ (const unsigned long long x, const cl_R& y)
        { return cl_I(x) / y; }
-#endif
 inline const cl_F operator/ (const float x, const cl_R& y)
        { return The(cl_F)(cl_R(x) / y); }
 inline const cl_F operator/ (const double x, const cl_R& y)
@@ -233,12 +219,10 @@ inline const cl_R operator/ (const cl_R& x, const long y)
        { return x / cl_I(y); }
 inline const cl_R operator/ (const cl_R& x, const unsigned long y)
        { return x / cl_I(y); }
-#ifdef HAVE_LONGLONG
 inline const cl_R operator/ (const cl_R& x, const long long y)
        { return x / cl_I(y); }
 inline const cl_R operator/ (const cl_R& x, const unsigned long long y)
        { return x / cl_I(y); }
-#endif
 inline const cl_R operator/ (const cl_R& x, const float y)
        { return x / cl_R(y); }
 inline const cl_R operator/ (const cl_R& x, const double y)
@@ -534,20 +518,16 @@ inline cl_R& operator+= (cl_R& x, const int y) { return x = x + y; }
 inline cl_R& operator+= (cl_R& x, const unsigned int y) { return x = x + y; }
 inline cl_R& operator+= (cl_R& x, const long y) { return x = x + y; }
 inline cl_R& operator+= (cl_R& x, const unsigned long y) { return x = x + y; }
-#ifdef HAVE_LONGLONG
 inline cl_R& operator+= (cl_R& x, const long long y) { return x = x + y; }
 inline cl_R& operator+= (cl_R& x, const unsigned long long y) { return x = x + y; }
-#endif
 inline cl_F& operator+= (cl_R& x, const float y) { return static_cast<cl_F&>(x = x + y); }
 inline cl_F& operator+= (cl_R& x, const double y) { return static_cast<cl_F&>(x = x + y); }
 inline cl_F& operator+= (cl_F& x, const int y) { return x = x + y; }
 inline cl_F& operator+= (cl_F& x, const unsigned int y) { return x = x + y; }
 inline cl_F& operator+= (cl_F& x, const long y) { return x = x + y; }
 inline cl_F& operator+= (cl_F& x, const unsigned long y) { return x = x + y; }
-#ifdef HAVE_LONGLONG
 inline cl_F& operator+= (cl_F& x, const long long y) { return x = x + y; }
 inline cl_F& operator+= (cl_F& x, const unsigned long long y) { return x = x + y; }
-#endif
 inline cl_R& operator++ /* prefix */ (cl_R& x) { return x = plus1(x); }
 inline void operator++ /* postfix */ (cl_R& x, int dummy) { (void)dummy; x = plus1(x); }
 inline cl_R& operator-= (cl_R& x, const cl_R& y) { return x = x - y; }
@@ -558,20 +538,16 @@ inline cl_R& operator-= (cl_R& x, const int y) { return x = x - y; }
 inline cl_R& operator-= (cl_R& x, const unsigned int y) { return x = x - y; }
 inline cl_R& operator-= (cl_R& x, const long y) { return x = x - y; }
 inline cl_R& operator-= (cl_R& x, const unsigned long y) { return x = x - y; }
-#ifdef HAVE_LONGLONG
 inline cl_R& operator-= (cl_R& x, const long long y) { return x = x - y; }
 inline cl_R& operator-= (cl_R& x, const unsigned long long y) { return x = x - y; }
-#endif
 inline cl_F& operator-= (cl_R& x, const float y) { return static_cast<cl_F&>(x = x - y); }
 inline cl_F& operator-= (cl_R& x, const double y) { return static_cast<cl_F&>(x = x - y); }
 inline cl_F& operator-= (cl_F& x, const int y) { return x = x - y; }
 inline cl_F& operator-= (cl_F& x, const unsigned int y) { return x = x - y; }
 inline cl_F& operator-= (cl_F& x, const long y) { return x = x - y; }
 inline cl_F& operator-= (cl_F& x, const unsigned long y) { return x = x - y; }
-#ifdef HAVE_LONGLONG
 inline cl_F& operator-= (cl_F& x, const long long y) { return x = x - y; }
 inline cl_F& operator-= (cl_F& x, const unsigned long long y) { return x = x - y; }
-#endif
 inline cl_R& operator-- /* prefix */ (cl_R& x) { return x = minus1(x); }
 inline void operator-- /* postfix */ (cl_R& x, int dummy) { (void)dummy; x = minus1(x); }
 inline cl_R& operator*= (cl_R& x, const cl_R& y) { return x = x * y; }
@@ -579,10 +555,8 @@ inline cl_R& operator*= (cl_R& x, const int y) { return x = x * y; }
 inline cl_R& operator*= (cl_R& x, const unsigned int y) { return x = x * y; }
 inline cl_R& operator*= (cl_R& x, const long y) { return x = x * y; }
 inline cl_R& operator*= (cl_R& x, const unsigned long y) { return x = x * y; }
-#ifdef HAVE_LONGLONG
 inline cl_R& operator*= (cl_R& x, const long long y) { return x = x * y; }
 inline cl_R& operator*= (cl_R& x, const unsigned long long y) { return x = x * y; }
-#endif
 inline cl_R& operator*= (cl_R& x, const float y) { return x = x * y; }
 inline cl_R& operator*= (cl_R& x, const double y) { return x = x * y; }
 inline cl_R& operator/= (cl_R& x, const cl_R& y) { return x = x / y; }
@@ -593,20 +567,16 @@ inline cl_R& operator/= (cl_R& x, const int y) { return x = x / y; }
 inline cl_R& operator/= (cl_R& x, const unsigned int y) { return x = x / y; }
 inline cl_R& operator/= (cl_R& x, const long y) { return x = x / y; }
 inline cl_R& operator/= (cl_R& x, const unsigned long y) { return x = x / y; }
-#ifdef HAVE_LONGLONG
 inline cl_R& operator/= (cl_R& x, const long long y) { return x = x / y; }
 inline cl_R& operator/= (cl_R& x, const unsigned long long y) { return x = x / y; }
-#endif
 inline cl_R& operator/= (cl_R& x, const float y) { return x = x / y; }
 inline cl_R& operator/= (cl_R& x, const double y) { return x = x / y; }
 inline cl_F& operator/= (cl_F& x, const int y) { return x = x / y; }
 inline cl_F& operator/= (cl_F& x, const unsigned int y) { return x = x / y; }
 inline cl_F& operator/= (cl_F& x, const long y) { return x = x / y; }
 inline cl_F& operator/= (cl_F& x, const unsigned long y) { return x = x / y; }
-#ifdef HAVE_LONGLONG
 inline cl_F& operator/= (cl_F& x, const long long y) { return x = x / y; }
 inline cl_F& operator/= (cl_F& x, const unsigned long long y) { return x = x / y; }
-#endif
 
 
 // Complex operations, trivial for reals
index 44f25e31df1d96b239bd0348bacaa435da861381..5129e5d580e3ba97e9ab0fdfa176175a16282f38 100644 (file)
@@ -22,10 +22,8 @@ public:
        cl_R (const unsigned int);      // argument must be < 2^29
        cl_R (const long);
        cl_R (const unsigned long);
-#ifdef HAVE_LONGLONG
        cl_R (const long long);
        cl_R (const unsigned long long);
-#endif
        cl_R (const float);
        cl_R (const double);
        cl_R& operator= (const int);            // |argument| must be < 2^29
@@ -34,10 +32,8 @@ public:
        cl_R& operator= (const unsigned long);
        cl_R& operator= (const float);
        cl_R& operator= (const double);
-#ifdef HAVE_LONGLONG
        cl_R& operator= (const long long);
        cl_R& operator= (const unsigned long long);
-#endif
 // Other constructors.
        cl_R (const char *);
 // Private constructor.
@@ -64,10 +60,8 @@ CL_DEFINE_INT_CONSTRUCTORS(cl_R)
 CL_DEFINE_INT_ASSIGNMENT_OPERATORS(cl_R)
 CL_DEFINE_LONG_CONSTRUCTORS(cl_R)
 CL_DEFINE_LONG_ASSIGNMENT_OPERATORS(cl_R)
-#ifdef HAVE_LONGLONG
 CL_DEFINE_LONGLONG_CONSTRUCTORS(cl_R)
 CL_DEFINE_LONGLONG_ASSIGNMENT_OPERATORS(cl_R)
-#endif
 CL_DEFINE_FLOAT_CONSTRUCTOR(cl_R)
 CL_DEFINE_DOUBLE_CONSTRUCTOR(cl_R)
 
index 7ec3770e9a125c0d8bd35cf347ef9fe93910b77d..25284ff9437c147fae8e442c51022fbafffd1aa4 100644 (file)
   #if (long_bitsize==64)
     typedef long           sint64;
     typedef unsigned long  uint64;
-    #undef HAVE_LONGLONG
-    #define HAVE_LONGLONG
-  #elif defined(HAVE_LONGLONG)
-   #if defined(long_long_bitsize) && (long_long_bitsize==64)
+  #elif (long_long_bitsize==64)
     typedef long long           sint64;
     typedef unsigned long long  uint64;
-   #else // unusable type
-    #undef HAVE_LONGLONG
-   #endif
+  #else
+    #error "No 64 bit integer type?"
   #endif
-  #if defined(HAVE_LONGLONG) && (defined(__alpha__) || defined(__ia64__) || defined(__mips64__) || defined(__powerpc64__) || defined(__s390x__) || (defined(__sparc__) && defined(__arch64__)) || (defined(__x86_64__) || defined(_M_AMD64)) || defined(__aarch64__) || (defined(__riscv) && __riscv_xlen == 64)) || defined(__e2k__)
+  #if (defined(__alpha__) || defined(__ia64__) || defined(__mips64__) || defined(__powerpc64__) || defined(__s390x__) || (defined(__sparc__) && defined(__arch64__)) || (defined(__x86_64__) || defined(_M_AMD64)) || defined(__aarch64__) || (defined(__riscv) && __riscv_xlen == 64) || defined(__e2k__))
     // 64 bit registers in hardware
     #define HAVE_FAST_LONGLONG
   #endif
   #define intLsize 32
   typedef sint32 sintL;
   typedef uint32 uintL;
-  #ifdef HAVE_LONGLONG
-    #define intQsize 64
-    typedef sint64 sintQ;
-    typedef uint64 uintQ;
-  #endif
+  #define intQsize 64
+  typedef sint64 sintQ;
+  typedef uint64 uintQ;
 
 // Type for three values (0, +1, -1).
   typedef int  cl_signean;
@@ -91,7 +85,7 @@
 
 // Integer type used for lfloat exponents.
 // Constraint: sizeof(uintE) >= sizeof(uintC)
-  #if (defined(HAVE_LONGLONG) && (defined(__alpha__) || defined(__ia64__) || defined(__powerpc64__) || defined(__s390x__) || (defined(__sparc__) && defined(__arch64__)) || defined(__x86_64__) || defined(__i386__) || defined(__mips__) || defined(__rs6000__) || defined(__aarch64__) || (defined(__riscv) && __riscv_xlen == 64) || defined(__e2k__)))
+  #if (defined(__alpha__) || defined(__ia64__) || defined(__powerpc64__) || defined(__s390x__) || (defined(__sparc__) && defined(__arch64__)) || defined(__x86_64__) || defined(__i386__) || defined(__mips__) || defined(__rs6000__) || defined(__aarch64__) || (defined(__riscv) && __riscv_xlen == 64) || defined(__e2k__))
     #define intEsize 64
     typedef sint64  sintE;
     typedef uint64  uintE;
index 6afda75b2af015474ef0492de073eaf4f14079d3..1a84e56ffeda2b086964f7453af941b40e0f7700 100644 (file)
@@ -1,14 +1,13 @@
-# floatparam.m4 serial 1
-dnl Copyright (C) 2005 Free Software Foundation, Inc.
+# floatparam.m4 serial 3  -*- Autoconf -*-
+dnl Copyright (C) 2005-2008, 2017 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
-dnl From Bruno Haible.
+dnl From Bruno Haible, Sam Steingold.
 
 AC_DEFUN([CL_FLOATPARAM_CROSS],
 [
-  AC_REQUIRE([CL_LONGDOUBLE])
   cl_machine_file_h=$1
   {
     echo "/* Rounding modes, for use below */"
@@ -17,21 +16,29 @@ AC_DEFUN([CL_FLOATPARAM_CROSS],
     echo "#define rounds_to_infinity       2  /* 1 ulp */"
     echo "#define rounds_to_minus_infinity 3  /* 1 ulp */"
     echo
-    for type in float double "`if test $cl_cv_c_longdouble = yes; then echo 'long double'; fi`"; do
+    for type in float double "long double"; do
       if test -n "$type"; then
         epsilon_bits=-1; y="($type)1.0"
         while true; do
-          AC_TRY_COMPILE([],
-            [static_assert((($type)(($type)1.0 + ($type)($y)) == ($type)1.0)
-                         || ($type)(($type)(($type)1.0 + ($type)($y)) - ($type)1.0) != ($type)($y), "");],
+          AC_COMPILE_IFELSE(
+            [AC_LANG_PROGRAM([],
+               [[typedef int verify[2*(
+                  (($type)(($type)1.0 + ($type)($y)) == ($type)1.0)
+                  || ($type)(($type)(($type)1.0 + ($type)($y)) - ($type)1.0) != ($type)($y)
+                 ) - 1];]])
+            ],
             [break;])
           epsilon_bits=`expr $epsilon_bits + 1`; y="$y * ($type)0.5"
         done
         negepsilon_bits=-1; y="($type)-1.0"
         while true; do
-          AC_TRY_COMPILE([],
-            [static_assert((($type)(($type)1.0 + ($type)($y)) == ($type)1.0)
-                         || ($type)(($type)(($type)1.0 + ($type)($y)) - ($type)1.0) != ($type)($y), "");],
+          AC_COMPILE_IFELSE(
+            [AC_LANG_PROGRAM([],
+               [[typedef int verify[2*(
+                  (($type)(($type)1.0 + ($type)($y)) == ($type)1.0)
+                  || ($type)(($type)(($type)1.0 + ($type)($y)) - ($type)1.0) != ($type)($y)
+                 ) - 1];]])
+            ],
             [break;])
           negepsilon_bits=`expr $negepsilon_bits + 1`; y="$y * ($type)0.5"
         done
@@ -63,23 +70,39 @@ AC_DEFUN([CL_FLOATPARAM_CROSS],
         zs2="($type)(($type)-1.0 + ($type)(-5.6)*$x)"
         rounds=
         if test -z "$rounds"; then
-          AC_TRY_COMPILE([],
-            [static_assert($ys1 == $y1 && $ys2 == $y2 && $zs1 == $z1 && $zs2 == $z2, "");],
+          AC_COMPILE_IFELSE(
+            [AC_LANG_PROGRAM([],
+               [[typedef int verify[2*(
+                  $ys1 == $y1 && $ys2 == $y2 && $zs1 == $z1 && $zs2 == $z2
+                 ) - 1];]])
+            ],
             [rounds=rounds_to_nearest])
         fi
         if test -z "$rounds"; then
-          AC_TRY_COMPILE([],
-            [static_assert($ys1 == $y1 && $ys2 == $y1 && $zs1 == $z1 && $zs2 == $z1, "");],
+          AC_COMPILE_IFELSE(
+            [AC_LANG_PROGRAM([],
+               [[typedef int verify[2*(
+                  $ys1 == $y1 && $ys2 == $y1 && $zs1 == $z1 && $zs2 == $z1
+                 ) - 1];]])
+            ],
             [rounds=rounds_to_zero])
         fi
         if test -z "$rounds"; then
-          AC_TRY_COMPILE([],
-            [static_assert($ys1 == $y2 && $ys2 == $y2 && $zs1 == $z1 && $zs2 == $z1, "");],
+          AC_COMPILE_IFELSE(
+            [AC_LANG_PROGRAM([],
+               [[typedef int verify[2*(
+                  $ys1 == $y2 && $ys2 == $y2 && $zs1 == $z1 && $zs2 == $z1
+                 ) - 1];]])
+            ],
             [rounds=rounds_to_infinity])
         fi
         if test -z "$rounds"; then
-          AC_TRY_COMPILE([],
-            [static_assert($ys1 == $y1 && $ys2 == $y1 && $zs1 == $z2 && $zs2 == $z2, "");],
+          AC_COMPILE_IFELSE(
+            [AC_LANG_PROGRAM([],
+               [[typedef int verify[2*(
+                  $ys1 == $y1 && $ys2 == $y1 && $zs1 == $z2 && $zs2 == $z2
+                 ) - 1];]])
+            ],
             [rounds=rounds_to_minus_infinity])
         fi
         if test -n "$rounds"; then
@@ -96,17 +119,23 @@ AC_DEFUN([CL_FLOATPARAM_CROSS],
     dnl 2.5495230282078065     = { 0x40 0x04 0x65 0x6C 0x54 0x54 0x69 0x4C } ..elTTiL
     dnl 1.4139248369879473e214 = { 0x6C 0x65 0x00 0x00 0x4C 0x69 0x54 0x54 } le..LiTT
     double_wordorder_bigendian_p=
-    AC_TRY_COMPILE([double a[9] = {
-       0, 2.5479915693083957, 0, 1.4396527506122064e164,
-       0, 2.5495230282078065, 0, 1.4139248369879473e214,
-       0 };], [], [
-      if grep LiTTle conftest.$ac_objext >/dev/null ; then
-        double_wordorder_bigendian_p=0
-      else
-        if grep bIgeN conftest.$ac_objext >/dev/null ; then
-          double_wordorder_bigendian_p=1
-        fi
-      fi])
+    AC_COMPILE_IFELSE(
+      [AC_LANG_PROGRAM([[
+         double a[9] = {
+           0, 2.5479915693083957, 0, 1.4396527506122064e164,
+           0, 2.5495230282078065, 0, 1.4139248369879473e214,
+           0 };
+         ]],
+         [])
+      ],
+      [if grep LiTTle conftest.$ac_objext >/dev/null; then
+         double_wordorder_bigendian_p=0
+       else
+         if grep bIgeN conftest.$ac_objext >/dev/null; then
+           double_wordorder_bigendian_p=1
+         fi
+       fi
+      ])
     if test -n "$double_wordorder_bigendian_p"; then
       echo "#define double_wordorder_bigendian_p $double_wordorder_bigendian_p"
     else
index 3c990d77d2a5d6f3dfa3701f9dc48096d7493d74..2619013a8553cf9e380ebd88f43b2699d35e3277 100644 (file)
@@ -1,15 +1,13 @@
-# intparam.m4 serial 1
-dnl Copyright (C) 2005 Free Software Foundation, Inc.
+# intparam.m4 serial 4  -*- Autoconf -*-
+dnl Copyright (C) 1993-2008, 2017, 2020 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
-dnl From Bruno Haible.
+dnl From Bruno Haible, Sam Steingold
 
 AC_DEFUN([CL_INTPARAM_CROSS],
 [
-  AC_REQUIRE([CL_LONGLONG])
-  AC_REQUIRE([CL_LONGDOUBLE])
   AC_REQUIRE([AC_C_BIGENDIAN])
   cl_machine_file_h=$1
   {
@@ -17,16 +15,12 @@ AC_DEFUN([CL_INTPARAM_CROSS],
     CL_INTPARAM_BITSIZE([short], [short_bitsize])
     CL_INTPARAM_BITSIZE([int], [int_bitsize])
     CL_INTPARAM_BITSIZE([long], [long_bitsize])
-    if test $cl_cv_c_longlong = yes; then
-      CL_INTPARAM_BITSIZE([long long], [longlong_bitsize])
-    fi
+    CL_INTPARAM_BITSIZE([long long], [longlong_bitsize])
     CL_INTPARAM_BITSIZE([unsigned char], [uchar_bitsize])
     CL_INTPARAM_BITSIZE([unsigned short], [ushort_bitsize])
     CL_INTPARAM_BITSIZE([unsigned int], [uint_bitsize])
     CL_INTPARAM_BITSIZE([unsigned long], [ulong_bitsize])
-    if test $cl_cv_c_longlong = yes; then
-      CL_INTPARAM_BITSIZE([unsigned long long], [ulonglong_bitsize])
-    fi
+    CL_INTPARAM_BITSIZE([unsigned long long], [ulonglong_bitsize])
     if test -n "$char_bitsize"; then
       echo "/* Integers of type char have $char_bitsize bits. */"
       echo "#define char_bitsize $char_bitsize"
@@ -55,14 +49,12 @@ AC_DEFUN([CL_INTPARAM_CROSS],
     else
       echo "#error \"Integers of type long have no binary representation!!\""
     fi
-    if test $cl_cv_c_longlong = yes; then
-      if test -n "$longlong_bitsize"; then
-        echo "/* Integers of type long long have $longlong_bitsize bits. */"
-        echo "#define long_long_bitsize $longlong_bitsize"
-        echo
-      else
-        echo "#error \"Integers of type long long have no binary representation!!\""
-      fi
+    if test -n "$longlong_bitsize"; then
+      echo "/* Integers of type long long have $longlong_bitsize bits. */"
+      echo "#define long_long_bitsize $longlong_bitsize"
+      echo
+    else
+      echo "#error \"Integers of type long long have no binary representation!!\""
     fi
     if test -n "$uchar_bitsize"; then
       echo "/* Integers of type unsigned char have $uchar_bitsize bits. */"
@@ -88,13 +80,11 @@ AC_DEFUN([CL_INTPARAM_CROSS],
     else
       echo "#error \"Integers of type unsigned long have no binary representation!!\""
     fi
-    if test $cl_cv_c_longlong = yes; then
-      if test -n "$ulonglong_bitsize"; then
-        echo "/* Integers of type unsigned long long have $ulonglong_bitsize bits. */"
-        echo
-      else
-        echo "#error \"Integers of type unsigned long long have no binary representation!!\""
-      fi
+    if test -n "$ulonglong_bitsize"; then
+      echo "/* Integers of type unsigned long long have $ulonglong_bitsize bits. */"
+      echo
+    else
+      echo "#error \"Integers of type unsigned long long have no binary representation!!\""
     fi
     if test "$char_bitsize" != "$uchar_bitsize"; then
       echo "#error \"Integer types char and unsigned char have different sizes!!\""
@@ -108,12 +98,11 @@ AC_DEFUN([CL_INTPARAM_CROSS],
     if test "$long_bitsize" != "$ulong_bitsize"; then
       echo "#error \"Integer types long and unsigned long have different sizes!!\""
     fi
-    if test $cl_cv_c_longlong = yes; then
-      if test "$longlong_bitsize" != "$ulonglong_bitsize"; then
-        echo "#error \"Integer types long long and unsigned long long have different sizes!!\""
-      fi
+    if test "$longlong_bitsize" != "$ulonglong_bitsize"; then
+      echo "#error \"Integer types long long and unsigned long long have different sizes!!\""
     fi
-    AC_TRY_COMPILE([#include <stdint.h>], [static_assert(sizeof(char*) <= sizeof(intptr_t), "");],
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdint.h>]],
+      [[typedef int verify[2*(sizeof(char*)<=sizeof (intptr_t))-1];]])],
       [], [echo "#error \"Type char * does not fit into an intptr_t!!\""])
     _AC_COMPUTE_INT([sizeof (char *)], [pointer_size])
     pointer_bitsize=`expr $pointer_size '*' $char_bitsize`
@@ -160,18 +149,16 @@ AC_DEFUN([CL_INTPARAM_CROSS],
     CL_INTPARAM_ALIGNOF([unsigned long], [alignment_ulong])
     echo "/* Type unsigned long has sizeof = $sizeof_ulong and alignment = $alignment_ulong. */"
     echo
-    if test $cl_cv_c_longlong = yes; then
-      CL_INTPARAM_SIZEOF([long long], [sizeof_longlong])
-      CL_INTPARAM_ALIGNOF([long long], [alignment_longlong])
-      echo "/* Type long long has sizeof = $sizeof_longlong and alignment = $alignment_longlong. */"
-      echo "#define sizeof_long_long $sizeof_longlong"
-      echo "#define alignment_long_long $alignment_longlong"
-      echo
-      CL_INTPARAM_SIZEOF([unsigned long long], [sizeof_ulonglong])
-      CL_INTPARAM_ALIGNOF([unsigned long long], [alignment_ulonglong])
-      echo "/* Type unsigned long long has sizeof = $sizeof_ulonglong and alignment = $alignment_ulonglong. */"
-      echo
-    fi
+    CL_INTPARAM_SIZEOF([long long], [sizeof_longlong])
+    CL_INTPARAM_ALIGNOF([long long], [alignment_longlong])
+    echo "/* Type long long has sizeof = $sizeof_longlong and alignment = $alignment_longlong. */"
+    echo "#define sizeof_long_long $sizeof_longlong"
+    echo "#define alignment_long_long $alignment_longlong"
+    echo
+    CL_INTPARAM_SIZEOF([unsigned long long], [sizeof_ulonglong])
+    CL_INTPARAM_ALIGNOF([unsigned long long], [alignment_ulonglong])
+    echo "/* Type unsigned long long has sizeof = $sizeof_ulonglong and alignment = $alignment_ulonglong. */"
+    echo
     CL_INTPARAM_SIZEOF([float], [sizeof_float])
     CL_INTPARAM_ALIGNOF([float], [alignment_float])
     echo "/* Type float has sizeof = $sizeof_float and alignment = $alignment_float. */"
@@ -184,14 +171,12 @@ AC_DEFUN([CL_INTPARAM_CROSS],
     echo "#define sizeof_double $sizeof_double"
     echo "#define alignment_double $alignment_double"
     echo
-    if test $cl_cv_c_longdouble = yes; then
-      CL_INTPARAM_SIZEOF([long double], [sizeof_longdouble])
-      CL_INTPARAM_ALIGNOF([long double], [alignment_longdouble])
-      echo "/* Type long double has sizeof = $sizeof_longdouble and alignment = $alignment_longdouble. */"
-      echo "#define sizeof_long_double $sizeof_longdouble"
-      echo "#define alignment_long_double $alignment_longdouble"
-      echo
-    fi
+    CL_INTPARAM_SIZEOF([long double], [sizeof_longdouble])
+    CL_INTPARAM_ALIGNOF([long double], [alignment_longdouble])
+    echo "/* Type long double has sizeof = $sizeof_longdouble and alignment = $alignment_longdouble. */"
+    echo "#define sizeof_long_double $sizeof_longdouble"
+    echo "#define alignment_long_double $alignment_longdouble"
+    echo
     CL_INTPARAM_SIZEOF([char *], [sizeof_char_ptr])
     CL_INTPARAM_ALIGNOF([char *], [alignment_char_ptr])
     echo "/* Type char * has sizeof = $sizeof_char_ptr and alignment = $alignment_char_ptr. */"
@@ -200,8 +185,13 @@ AC_DEFUN([CL_INTPARAM_CROSS],
     CL_INTPARAM_ALIGNOF([long *], [alignment_long_ptr])
     echo "/* Type long * has sizeof = $sizeof_long_ptr and alignment = $alignment_long_ptr. */"
     echo
-    CL_INTPARAM_SIZEOF([void (*)(void)], [sizeof_function_ptr])
-    CL_INTPARAM_ALIGNOF([void (*)(void)], [alignment_function_ptr])
+    dnl disabled because:
+    dnl - the results of these are not used anywhere
+    dnl - the results of non-cross are not generated (see src/intparam.h)
+    dnl - the C code fails with "expected identifier or '(' before ')' token"
+    dnl   on the line "typedef int verify[2*(alignof(void (*)(void)) == 256) - 1];"
+    dnl CL_INTPARAM_SIZEOF([void (*)(void)], [sizeof_function_ptr])
+    dnl CL_INTPARAM_ALIGNOF([void (*)(void)], [alignment_function_ptr])
     echo "/* Type function * has sizeof = $sizeof_function_ptr and alignment = $alignment_function_ptr. */"
     echo
     case $ac_cv_c_bigendian in
@@ -212,10 +202,8 @@ AC_DEFUN([CL_INTPARAM_CROSS],
         echo "#define int_big_endian"
         echo "/* Type unsigned long is stored BIG-ENDIAN in memory (i.e. like mc68000 or sparc). */"
         echo "#define long_big_endian"
-        if test $cl_cv_c_longlong = yes; then
-          echo "/* Type unsigned long long is stored BIG-ENDIAN in memory (i.e. like mc68000 or sparc). */"
-          echo "#define long_long_big_endian"
-        fi
+        echo "/* Type unsigned long long is stored BIG-ENDIAN in memory (i.e. like mc68000 or sparc). */"
+        echo "#define long_long_big_endian"
         ;;
       no)
         echo "/* Type unsigned short is stored LITTLE-ENDIAN in memory (i.e. like Z80 or VAX). */"
@@ -224,18 +212,14 @@ AC_DEFUN([CL_INTPARAM_CROSS],
         echo "#define int_little_endian"
         echo "/* Type unsigned long is stored LITTLE-ENDIAN in memory (i.e. like Z80 or VAX). */"
         echo "#define long_little_endian"
-        if test $cl_cv_c_longlong = yes; then
-          echo "/* Type unsigned long long is stored LITTLE-ENDIAN in memory (i.e. like Z80 or VAX). */"
-          echo "#define long_long_little_endian"
-        fi
+        echo "/* Type unsigned long long is stored LITTLE-ENDIAN in memory (i.e. like Z80 or VAX). */"
+        echo "#define long_long_little_endian"
         ;;
       *)
         echo "#error \"Type short is stored in memory in an obscure manner!!\""
         echo "#error \"Type int is stored in memory in an obscure manner!!\""
         echo "#error \"Type long is stored in memory in an obscure manner!!\""
-        if test $cl_cv_c_longlong = yes; then
-          echo "#error \"Type long long is stored in memory in an obscure manner!!\""
-        fi
+        echo "#error \"Type long long is stored in memory in an obscure manner!!\""
         ;;
     esac
     echo
@@ -258,7 +242,8 @@ AC_DEFUN([CL_INTPARAM_BITSIZE],
 [
   n=1; x="($1)2"
   while true; do
-    AC_TRY_COMPILE([], [typedef int verify[2*(($1)($x) == 0) - 1];],
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
+      [[typedef int verify[2*(($1)($x) == 0) - 1];]])],
       [$2=$n; break;],
       [if test $n = 1000; then $2=; break; fi;])
     n=`expr $n + 1`; x="$x * ($1)2"
@@ -274,23 +259,25 @@ AC_DEFUN([CL_INTPARAM_SIZEOF],
 
 dnl CL_INTPARAM_ALIGNOF(type, variable)
 dnl puts into variable the determined alignment of the type.
-AC_DEFUN([CL_INTPARAM_ALIGNOF],
-[
+AC_DEFUN([CL_INTPARAM_ALIGNOF],[
   dnl Simplify the guessing by assuming that the alignment is a power of 2.
   n=1
   while true; do
-    AC_TRY_COMPILE([
-#ifdef __cplusplus
-# ifdef __GNUC__
-#  define alignof(type)  __alignof__ (type)
-# else
-   template <class type> struct alignof_helper { char slot1; type slot2; };
-#  define alignof(type)  offsetof (alignof_helper<type>, slot2)
-# endif
-#else
-# define alignof(type)  offsetof (struct { char slot1; type slot2; }, slot2)
-#endif
-], [static_assert(alignof($1) == $n, "");],
+    AC_COMPILE_IFELSE(
+      [AC_LANG_PROGRAM([[
+         #include <stddef.h>
+         #ifdef __cplusplus
+          #ifdef __GNUC__
+           #define alignof(type)  __alignof__ (type)
+          #else
+           template <class type> struct alignof_helper { char slot1; type slot2; };
+           #define alignof(type)  offsetof (alignof_helper<type>, slot2)
+          #endif
+         #else
+          #define alignof(type)  offsetof (struct { char slot1; type slot2; }, slot2)
+         #endif
+         ]],
+         [[typedef int verify[2*(alignof($1) == $n) - 1];]])],
       [$2=$n; break;]
       [if test $n = 0; then $2=; break; fi])
     n=`expr $n '*' 2`
diff --git a/m4/longdouble.m4 b/m4/longdouble.m4
deleted file mode 100644 (file)
index e51c4c5..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-dnl Copyright (C) 1993-2006 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
-
-dnl From Bruno Haible, Marcus Daniels, Paul Eggert.
-
-AC_PREREQ(2.13)
-
-AC_DEFUN([CL_LONGDOUBLE],
-[AC_CACHE_CHECK(for long double type, cl_cv_c_longdouble, [
-AC_TRY_RUN([
-#include <stdlib.h>
-int main()
-{ long double x = 2.7182818284590452354L; x = x*x; exit (x==0.0L); }
-],
-cl_cv_c_longdouble=yes, cl_cv_c_longdouble=no, [
-dnl When cross-compiling, use the test from gnulib.
-AC_TRY_COMPILE([
-  /* The Stardent Vistra knows sizeof(long double), but does not support it.  */
-  long double foo = 0.0;
-  /* On Ultrix 4.3 cc, long double is 4 and double is 8.  */
-  int array [2*(sizeof(long double) >= sizeof(double)) - 1];
-  ], , cl_cv_c_longdouble=yes, cl_cv_c_longdouble=no)])
-])
-if test $cl_cv_c_longdouble = yes; then
-  AC_DEFINE(HAVE_LONGDOUBLE, ,[Define if compiler supports long double type])
-fi
-])
diff --git a/m4/longlong.m4 b/m4/longlong.m4
deleted file mode 100644 (file)
index 78fae88..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-dnl -*- Autoconf -*-
-dnl Copyright (C) 1993-2006 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
-
-dnl From Bruno Haible, Marcus Daniels, Sam Steingold, Paul Eggert.
-
-AC_PREREQ(2.57)
-
-AC_DEFUN([CL_LONGLONG],
-[AC_CACHE_CHECK(for long long type, cl_cv_c_longlong, [
-AC_TRY_RUN([
-#include <stdlib.h>
-int main()
-{
-/* long longs don't work right with gcc-2.7.2 on m68k */
-/* long longs don't work right with gcc-2.7.2 on rs6000: avcall/tests.c gets
-   miscompiled. */
-#if defined(__m68k__) || (defined(_IBMR2) || defined(__powerpc))
-#if defined(__GNUC__) && (__GNUC__ == 2) && (__GNUC_MINOR__ <= 7)
-  exit(1);
-#endif
-#endif
-  { long x = 944938507; long y = 737962842; long z = 162359677;
-    exit(!(((long long) x)*((long long) y)>>32 == z));
-  }
-}],
-cl_cv_c_longlong=yes, cl_cv_c_longlong=no, [
-dnl When cross-compiling, use the test from gnulib.
-AC_TRY_LINK([long long ll = 1LL; int i = 63;],
-  [long long llmax = (long long) -1;
-   return ll << i | ll >> i | llmax / ll | llmax % ll;],
-  cl_cv_c_longlong=yes,
-  cl_cv_c_longlong=no)])
-])
-if test $cl_cv_c_longlong = yes; then
-  AC_DEFINE(HAVE_LONGLONG,,[compiler supports the `long long' type])
-fi
-])
index 21a7b84e2207a27f503122fd6200bc3f636c2305..bb21d368fc99c0bbab49ef52d0b7509c8bed6783 100644 (file)
@@ -1,5 +1,5 @@
 dnl -*- Autoconf -*-
-dnl Copyright (C) 1993-2005 Free Software Foundation, Inc.
+dnl Copyright (C) 1993-2008, 2011, 2017 Free Software Foundation, Inc.
 dnl This file is free software, distributed under the terms of the GNU
 dnl General Public License.  As a special exception to the GNU General
 dnl Public License, this file may be distributed as part of a program
@@ -8,47 +8,37 @@ dnl the same distribution terms as the rest of that program.
 
 dnl From Bruno Haible, Marcus Daniels, Sam Steingold.
 
-AC_PREREQ(2.13)
+AC_PREREQ([2.61])
 
 dnl CL_MACHINE([MESSAGE], [PROGRAM_TO_RUN], [CROSS_MACRO], [DESTINATION], [CACHE_VAR])
 AC_DEFUN([CL_MACHINE],
-[AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_C_CHAR_UNSIGNED])dnl
-cl_machine_file_c=$2
-if test -z "$[$5]"; then
-AC_CHECKING(for [$1])
-if test $cross_compiling = no; then
-cl_machine_file_h=$4
-cat > conftest.$ac_ext <<EOF
-#include "confdefs.h"
-EOF
-cat "$cl_machine_file_c" >> conftest.$ac_ext
-ORIGCC="$CC"
-if test $ac_cv_prog_gcc = yes; then
-# gcc -O (gcc version <= 2.3.2) crashes when compiling long long shifts for
-# target 80386. Strip "-O".
-CC=`echo "$CC " | sed -e 's/-O //g'`
-fi
-AC_TRY_EVAL(ac_link)
-CC="$ORIGCC"
-if test -s conftest${ac_exeext}; then
-  echo "creating $cl_machine_file_h"
-  ./conftest${ac_exeext} > conftest.h
-  if cmp -s "$cl_machine_file_h" conftest.h 2>/dev/null; then
-    # The file exists and we would not be changing it
+[
+  AC_REQUIRE([AC_PROG_CC])
+  AC_REQUIRE([AC_C_CHAR_UNSIGNED])
+  cl_machine_file_c=$2
+  if test -z "$[$5]"; then
+    AC_MSG_CHECKING(for [$1])
+    cl_machine_file_h=$4
+    cl_machine_file_program=`cat "$cl_machine_file_c"`
+    AC_RUN_IFELSE(
+      [AC_LANG_SOURCE([
+         #include "confdefs.h"
+         $cl_machine_file_program
+         ])],
+      [AC_MSG_RESULT([created $cl_machine_file_h])
+       if cmp -s "$cl_machine_file_h" conftest.h 2>/dev/null; then
+         # The file exists and we would not be changing it
+         rm -f conftest.h
+       else
+         rm -f "$cl_machine_file_h"
+         mv conftest.h "$cl_machine_file_h"
+       fi
+       [$5]=1
+      ],
+      [AC_MSG_RESULT([creation of $cl_machine_file_h failed])],
+      [AC_MSG_RESULT([creating $cl_machine_file_h])
+       $3([$4])
+      ])
     rm -f conftest.h
-  else
-    rm -f "$cl_machine_file_h"
-    mv conftest.h "$cl_machine_file_h"
   fi
-  [$5]=1
-else
-  echo "creation of $cl_machine_file_h failed"
-fi
-rm -f conftest*
-else
-echo "creating $cl_machine_file_h"
-$3([$4])
-fi
-fi
 ])
index d2b9cd111043409928725ac83cb59af06be8f7a9..ee47bf13d7d12d34c51659249d3796f6d57eff64 100644 (file)
@@ -77,8 +77,6 @@ inline uint32 highlow32_0 (uint16 high)
        return (uint32)high << 16;
 }
 
-#ifdef HAVE_LONGLONG
-
 // High-Word einer 64-Bit-Zahl bestimmen
 // high32(wert)
 inline uint32 high32 (uint64 wert)
@@ -107,8 +105,6 @@ inline uint64 highlow64_0 (uint32 high)
        return (uint64)high << 32;
 }
 
-#endif /* HAVE_LONGLONG */
-
 
 // Multipliziert zwei 16-Bit-Zahlen miteinander und liefert eine 32-Bit-Zahl:
 // mulu16(arg1,arg2)
@@ -287,7 +283,7 @@ inline uint32 mulu32_unchecked (uint32 arg1, uint32 arg2)
               );                                      \
        unused (hi_zuweisung _hi); lo_zuweisung _lo;   \
      })
-#elif defined(__GNUC__) && defined(HAVE_LONGLONG) && !defined(__arm__)
+#elif defined(__GNUC__) && !defined(__arm__)
   #define mulu32(x,y,hi_zuweisung,lo_zuweisung)  \
     ({ var register uint64 _prod = (uint64)(uint32)(x) * (uint64)(uint32)(y); \
        unused (hi_zuweisung (uint32)(_prod>>32));                             \
@@ -759,7 +755,7 @@ inline uint32 mulu32_unchecked (uint32 arg1, uint32 arg2)
      })
   #define divu_6432_3232_(xhi,xlo,y) \
     ({var uint32 ___q; divu_6432_3232(xhi,xlo,y,___q=,); ___q; })
-#elif defined(__GNUC__) && defined(HAVE_LONGLONG) && !defined(__arm__)
+#elif defined(__GNUC__) && !defined(__arm__)
   #define divu_6432_3232(xhi,xlo,y,q_zuweisung,r_zuweisung) \
     ({var uint32 __xhi = (xhi);                                                \
       var uint32 __xlo = (xlo);                                                \
@@ -1254,13 +1250,11 @@ inline uint32 mulu32_unchecked (uint32 arg1, uint32 arg2)
 // < uintL ergebnis : Wurzel, >=0, <2^16
   extern uintL isqrt (uintL x);
 
-#ifdef HAVE_LONGLONG
 // Extracts integer root of a 64-bit number and returns a 32-bit number.
 // isqrt(x)
 // > uintQ x : radicand, >=0, <2^64
 // < uintL result : square root, >=0, <2^32
   extern uintL isqrt (uintQ x);
-#endif
 
 // Sorry for this. We need an isqrt function taking uintC arguments but we
 // cannot use overloading since this would lead to ambiguities with any of the
index 5aa861fce2b754fa3391174d79de6e26b0e84904..4d91717c4a55d3c8de3ea88c69a814135c5f6dda 100644 (file)
@@ -82,7 +82,7 @@ inline sint32 sign_of_sintD (sintD wert)
   #if (intDsize==16)
     #define muluD  mulu16
   #endif
-  #if (intDsize==32) && defined(HAVE_LONGLONG)
+  #if (intDsize==32)
     #define muluD(arg1,arg2)  ((uintDD)(uintD)(arg1)*(uintDD)(uintD)(arg2))
   #endif
 #else
@@ -117,7 +117,7 @@ inline sint32 sign_of_sintD (sintD wert)
   #if (intDsize==16)
     #define divuD  divu_3216_1616
   #endif
-  #if (intDsize==32) && defined(HAVE_LONGLONG)
+  #if (intDsize==32)
     #define divuD(x,y,q_zuweisung,r_zuweisung) \
       { var uint64 __x = (x);                                 \
         var uint32 __y = (y);                                 \
index 6bd21232177afab32676cd6a185120bfdfe99095..371f1a833774231c50b3a96fbdfdc9735ae56477 100644 (file)
 #include "cln/floatparam.h"
 #include "cln/exception.h"
 
-#if defined(HAVE_LONGDOUBLE) && (long_double_mant_bits > double_mant_bits) && (defined(__i386__) || defined(__m68k__) || (defined(__sparc__) && 0))
+#if (long_double_mant_bits > double_mant_bits) && (defined(__i386__) || defined(__m68k__) || (defined(__sparc__) && 0))
 // Only these CPUs have fast "long double"s in hardware.
 // On SPARC, "long double"s are emulated in software and don't work.
 typedef long double fftc_real;
index 6269bf23fb0575079211badba77f1d3555c0e613..75b20de9ccce52a4f702af6182930480697c6617 100644 (file)
 #include "cln/exception.h"
 
 
-#if defined(HAVE_LONGDOUBLE) && (long_double_mant_bits > double_mant_bits) && (defined(__i386__) || defined(__m68k__) || (defined(__sparc__) && 0))
+#if (long_double_mant_bits > double_mant_bits) && (defined(__i386__) || defined(__m68k__) || (defined(__sparc__) && 0))
 // Only these CPUs have fast "long double"s in hardware.
 // On SPARC, "long double"s are emulated in software and don't work.
 typedef long double fftcs_real;
index d99da53837a7f1d4a5828ee2434898048b71b0d1..674edd78cd5bc195512c0dfcebfbc5e601c507be 100644 (file)
 #include "cln/exception.h"
 
 
-#if defined(HAVE_LONGDOUBLE) && (long_double_mant_bits > double_mant_bits) && (defined(__i386__) || defined(__m68k__) || (defined(__sparc__) && 0))
+#if (long_double_mant_bits > double_mant_bits) && (defined(__i386__) || defined(__m68k__) || (defined(__sparc__) && 0))
 // Only these CPUs have fast "long double"s in hardware.
 // On SPARC, "long double"s are emulated in software and don't work.
 typedef long double fftr_real;
index b9fb99c0aa213a92c19a2d1c89f756f2340feb71..3a43813756ee1f4f98af2536d2faa36260b5efad 100644 (file)
@@ -61,7 +61,6 @@ uintL isqrt (uintL x)
      }}
 }
 
-#ifdef HAVE_LONGLONG
 uintL isqrt (uintQ x)
 {
   // As isqrt (uintL) above, but with 64-bit numbers.
@@ -94,6 +93,5 @@ uintL isqrt (uintQ x)
          }
      }}
 }
-#endif
 
 }  // namespace cln
index 919327bde9b898223d3e8388d9474797f18adc3e..90679b2bcdab67dd59f902932eaea717dbf86bbc 100644 (file)
@@ -58,8 +58,6 @@ void fprintdecimal (std::ostream& stream, long x)
         fprintdecimal_impl(stream,(intptr_t)x);
 }
 
-#ifdef HAVE_LONGLONG
-
 void fprintdecimal (std::ostream& stream, unsigned long long x)
 {
 #if long_long_bitsize <= pointer_bitsize
@@ -94,6 +92,4 @@ void fprintdecimal (std::ostream& stream, long long x)
 #endif
 }
 
-#endif
-
 }  // namespace cln
index 69a6f56e0536aab05c4b59fa13990d4a5dfe292e..c823bbfbe6bc5f384e5dc67f465471470cc9c7c0 100644 (file)
@@ -55,8 +55,6 @@ void fprinthexadecimal (std::ostream& stream, long x)
         fprinthexadecimal_impl(stream,(intptr_t)x);
 }
 
-#ifdef HAVE_LONGLONG
-
 void fprinthexadecimal (std::ostream& stream, unsigned long long x)
 {
 #if long_long_bitsize <= pointer_bitsize
@@ -91,6 +89,4 @@ void fprinthexadecimal (std::ostream& stream, long long x)
 #endif
 }
 
-#endif
-
 }  // namespace cln